Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "This chapter also taught you how the new Attribute
class can be used as an eventual replacement for PHP DocBlocks."
A block of code is set as follows:
// /repo/ch01/php7_prop_reduce.php declare(strict_types=1); class Test { protected $id = 0; protected $token = 0; protected $name = '';o
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
$result = match(<EXPRESSION>) { <ITEM> => <EXPRESSION>, [<ITEM> => <EXPRESSION>,] default => <DEFAULT EXPRESSION> };
Any command-line input or output is written as follows:
Fatal error: Uncaught TypeError: Cannot assign string to property Test::$token of type int in /repo/ch01/php8_prop_danger.php:12
Tips or important notes
Appear like this.