summaryrefslogtreecommitdiffhomepage
path: root/php.html.markdown
diff options
context:
space:
mode:
authorAnton Ivanov <sendmailn@gmail.com>2015-10-31 14:37:12 +0300
committerAnton Ivanov <sendmailn@gmail.com>2015-10-31 14:37:12 +0300
commitb307b65e8df4e27991c8cf7ade1e3d7faa1e87fd (patch)
tree4c424daf46ebcb7dd475326be8634462ee95643b /php.html.markdown
parent8303f2ed3995d18950be4e62b2ced2e3dcd35620 (diff)
Add binary number example.
Diffstat (limited to 'php.html.markdown')
-rw-r--r--php.html.markdown6
1 files changed, 4 insertions, 2 deletions
diff --git a/php.html.markdown b/php.html.markdown
index 7b0cf61c..d03b89fe 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -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;
@@ -117,11 +119,11 @@ echo 'Multiple', 'Parameters', 'Valid'; // Returns 'MultipleParametersValid'
// a valid constant name starts with a letter or underscore,
// followed by any number of letters, numbers, or underscores.
-define("FOO", "something");
+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'