From dc7996c6e84f38a1cbb7e268c69275c7f19b792a Mon Sep 17 00:00:00 2001 From: Suhayb Alghutaymil Date: Wed, 22 Jan 2020 13:49:33 +0300 Subject: Remove an extra double quote --- php.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'php.html.markdown') diff --git a/php.html.markdown b/php.html.markdown index 40c9dd01..d4103e97 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -289,7 +289,7 @@ if (false) { print (false ? 'Does not get printed' : 'Does'); // ternary shortcut operator since PHP 5.3 -// equivalent of "$x ? $x : 'Does'"" +// equivalent of "$x ? $x : 'Does'" $x = false; print($x ?: 'Does'); -- cgit v1.2.3 From ea3d958179d0da54e2795733b782962f60662750 Mon Sep 17 00:00:00 2001 From: Alexar Date: Sat, 30 May 2020 05:02:34 +1000 Subject: Explains the weird behavior of PHP tag in a PHP script --- php.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'php.html.markdown') diff --git a/php.html.markdown b/php.html.markdown index d4103e97..96f30875 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -34,6 +34,7 @@ echo "World\n"; // Prints "World" with a line break ?> Hello World Again! Date: Sat, 30 May 2020 05:10:55 +1000 Subject: Explains variable declaration plus a minor improvement --- php.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'php.html.markdown') diff --git a/php.html.markdown b/php.html.markdown index d4103e97..e1411085 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -41,12 +41,15 @@ Hello World Again! */ // Variables begin with the $ symbol. -// A valid variable name starts with a letter or underscore, +// A valid variable name starts with a letter or an underscore, // followed by any number of letters, numbers, or underscores. +// You don't have to (and cannot) declare variables. +// Once you assign a value, PHP will create the variable with the right type. + // Boolean values are case-insensitive $boolean = true; // or TRUE or True -$boolean = false; // or FALSE or False +$boolean = FALSE; // or false or False // Integers $int1 = 12; // => 12 -- cgit v1.2.3