PHP Skills Tests
Operator precedence
| Associativity | Operators | Additional information |
|---|---|---|
| non-associative | clone new
|
clone and new |
| left | [
|
array() |
| right | **
|
arithmetic |
| right | ++ -- ~ (int) (float) (string) (array) (object) (bool) @
|
types and increment/decrement |
Associativity
TK
Hexidecimal values
echo 0x500; 1280
This is hexidecimal notation. The value is calculated 0 * 1 = 0 + 0 * 16 = 0 + 5 * 256 = 1280.
Bit shifting
TK
is_numeric()
- Valid values:
"200",".25e4","20,2" - Invalid values: "
$200"
Magical constants
Magical constants are constants that change value depending on where in the code they are placed.
The magical constants in PHP are
__LINE____FILE____DIR____FUNCTION____CLASS____TRAIT____METHOD____NAMESPACE__