Created
June 10, 2014 13:39
Test to see if we can use fn = fn || new Function(); in PHP as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Test var1 en var2 = 'iets'"; | |
$var1 = ""; | |
$var2 = "iets"; | |
$temp = $var1 || $var2; | |
echo " Result: ". $temp. "\n"; | |
var_dump($temp); | |
echo "Test var1 = 'iets' en var2 = ''"; | |
$var1 = "iets"; | |
$var2 = ""; | |
$temp = $var1 || $var2; | |
echo " Result: ". $temp. "\n"; | |
var_dump($temp); | |
echo "Test var1 = '' en var2 = ''"; | |
$var1 = ""; | |
$var2 = ""; | |
$temp = $var1 || $var2; | |
echo " Result: ". "\n"; | |
var_dump($temp); | |
// OUTPUT: | |
// Test var1 en var2 = 'iets' Result: 1 | |
// bool(true) | |
// Test var1 = 'iets' en var2 = '' Result: 1 | |
// bool(true) | |
// Test var1 = '' en var2 = '' Result: | |
// bool(false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment