Created
October 17, 2012 07:28
-
-
Save ThiefMaster/3904218 to your computer and use it in GitHub Desktop.
php is even more crappy than i thought
This file contains 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 | |
error_reporting(E_ALL|E_STRICT); | |
function crap(&$var) { | |
echo '$var='.$var."\n"; | |
$var = 'x'; | |
} | |
crap($x = 123); | |
# Strict Standards: Only variables should be passed by reference in php shell code on line 1 | |
echo '$x='.$x."\n"; | |
# 123 | |
crap($y); | |
echo '$y='.$y."\n"; | |
# x |
This file contains 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
Output: | |
Strict Standards: Only variables should be passed by reference in - on line 9 | |
$var=123 | |
$x=123 | |
$var= | |
$y=x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment