mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 21:52:31 +03:00
Add binary number example.
This commit is contained in:
parent
8303f2ed39
commit
b307b65e8d
@ -54,6 +54,8 @@ $int1 = 12; // => 12
|
||||
$int2 = -12; // => -12
|
||||
$int3 = 012; // => 10 (a leading 0 denotes an octal number)
|
||||
$int4 = 0x0F; // => 15 (a leading 0x denotes a hex literal)
|
||||
// Binary integer literals are available since PHP 5.4.0.
|
||||
$int5 = 0b11111111; // 255 (a leading 0b denotes a binary number)
|
||||
|
||||
// Floats (aka doubles)
|
||||
$float = 1.234;
|
||||
@ -121,7 +123,7 @@ define("FOO", "something");
|
||||
|
||||
// access to a constant is possible by calling the choosen name without a $
|
||||
echo FOO; // Returns 'something'
|
||||
echo 'This outputs '.FOO; // Returns 'This ouputs something'
|
||||
echo 'This outputs ' . FOO; // Returns 'This ouputs something'
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user