PHP 7 in Original

Aleksandr Shitik
Aleksandr Shitik

I write my own posts and books, and review movies and books. Expert in cosmology and astronomy, IT, productivity, and planning.

PHP 7 in Original
Dmitry Koterov, Igor Simdyanov
Genres: Programming
Year of publication: 2016
Year of reading: 2020
My rating: Highest
Number of reads: 1
Total pages: 1071
Summary (pages): 0
Original language of publication: Russian
Translations to other languages: No translations to other languages found

I usually do a mini retelling of all the chapters in reviews, but perhaps not in this case. Here I will limit myself to a brief summary of the 10 parts, combining all the chapters of this or that part into a single description. After that, at the very end, I will write my opinion about the book and try to highlight its pros and cons.

Fundamentals of Web Programming

Generally speaking, this book is not only about PHP, but also about the web, about the Internet. In principle, it is almost impossible to imagine the PHP language without the Internet - say, as an applied desktop program, a mobile application, or a driver for an operating system. That's why the authors of the book start from afar. For example, it covers such concepts as TCP/IP, server, provider, hosting, HTML document, port, and much more. GET and POST methods are explained, and there is a brief introduction to HTML (mostly forms), CGI, and the built-in PHP web server.

Basics of PHP

This section consists of 8 chapters and is devoted entirely to the basic concepts of the language. Those who are familiar with programming languages through books will more than understand what we are talking about: variables, data types, operations, conditional statements, loops, and the like. Of the not quite familiar here - perhaps, processing of data sent from forms, as well as generators. By the way, functions are also described here.

Standard PHP functions

PHP has a huge number of built-in functions for working with different data types, covering a wide variety of cases. Some of these functions, unfortunately, are no longer recommended for use even by the language developers. Nevertheless, those who don't want to read the official documentation (which I still believe is the primary source and contains a complete list of functions) can familiarize themselves with the list proposed by the authors of the book. All the more so because the most popular and frequently used functions are collected here. They are divided into groups, where each group is a separate chapter, so it will be easier for me to list the names of the chapters:

  • String Functions
  • Working with Arrays
  • Mathematical Functions
  • Working with Files and Directories
  • Access Rights and File Attributes
  • Starting External Programs
  • Working with Date and Time
  • Basics of Regular Expressions

Predefined Classes in PHP

If PHP has a lot of built-in functions for working with different data types, then of course many of them could be combined into classes for ease of use. Perhaps if the language developers had done this from the beginning - for example, with functions for working with strings or arrays - it would have been even more convenient (Laravel, for example, has such classes).

In the native language, however, slightly different sets of functions are grouped into classes. These include, for example, working with date and time, iterated data types, reflection (working with code), files and catalogs, etc.

Networking in PHP

Here we go back to the beginning of the book and cover the topic of networking, but with PHP tools. We cover setting and receiving headers, working with cookies and sessions, and working with URLs (in fact, we talk about PHP's global arrays, as well as some standard functions). This part of the book also shows examples of working with sockets and mail. Each of these topics is covered in some detail (except for sockets, perhaps).

PHP Extensions

Here we talk about extensions that we can enable and disable in the php.ini configuration file. Some of these extensions are built into the core language, while others are actually third-party and require additional steps to install and activate.

This part of the book explains how to install these extensions and how to enable them on different operating systems. A quick look at some php.ini directives and how, for example, to change the size of memory allowed.

One of the chapters in this section is devoted to security and filtering the input that needs to be accepted and processed-say, from user forms or URLs. The examples use regular expressions, so it's advisable to have a general idea of what these are.

Further chapters on MySQL, images, networking, and Memcached follow. On databases, a short introduction to the theory, from columns and rows to keys and data types. Examples of working with databases through both regular SQL queries and the PDO extension (actually, it's not surprising that PDO is mentioned in the topic of extensions - that's what the introductory course on database basics was for, in case the reader isn't familiar with them).

With regard to working with images, the GD extension is covered here. For networking, the php-curl extension was used, and for Memcached, the php7-memcached extension was used.

Libraries

There are several chapters covering what Composer is (and how to install and work with it), what Packagist is, and where to find third-party libraries. At the end of the chapter you will learn how to create a library that can be used by others. And to ensure that the future component meets a number of common requirements and standards, the authors introduce the reader to the PSR.

PHP Programming Techniques

One of the most ambiguous parts of the book, consisting of small chapters that are designed to show you how to work with code using real-world examples. These examples include: working with XML, working with forms (which has already been brought up many times, only here with file uploading), setting up redirects, working with HTML, and some other unrelated topics.

Deployment

Deployment is not a modern CI/CD solution. Rather, it's about installing Git, connecting via SSH, and installing some of the other tools you'll need to get up and running with PHP if you want to write more than just scripts. This includes installing a database, a web server, and a virtual machine.

Conclusion

Plusses

A very detailed book that is not boring to read and is accompanied by a huge number of examples and code inserts. There are extended descriptions for each topic. I would say that this book can be safely put on the second place in terms of informative and useful information - after the official documentation. As far as I'm concerned, this is the most detailed book about PHP I've ever seen.

Minuses

The book is not just big - it's huge. Many people may never make it to the finish line. Also, some of the material is outdated (hopefully, though, the authors are keeping track and releasing updated versions of the book).

Вверх