Variable scope on PHP
The scope of a variable is the context within which it is defined. For the most part all PHP variables only have a single scope.
The scope of a variable is the context within which it is defined. For the most part all PHP variables only have a single scope.
<?php // Unset AND unreferenced (no use context) variable; outputs NULL var_dump($unset_var); // Boolean usage; outputs ‘false’ (See ternary operators for more on this syntax)
Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. Variable names follow the
The special NULL value represents a variable with no value. NULL is the only possible value of type NULL. Note: The null type was introduced
To create a new object, use the new statement to instantiate a class: <?php class foo { function do_foo() { echo «Doing foo.»; } }
An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several
A string is series of characters, therefore, a character is the same as a byte. That is, there are exactly 256 different characters possible. This
Floating point numbers (also known as «floats», «doubles», or «real numbers») can be specified using any of the following syntaxes: <?php $a = 1.234; $b
An integer is a number of the set ? = {…, -2, -1, 0, 1, 2, …}. Syntax Integers can be specified in decimal (base
Four scalar types: boolean integer float (floating-point number, aka double) string Two compound types: array object And finally two special types: resource NULL This manual