Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster
Created October 17, 2012 07:28
Show Gist options
  • Save ThiefMaster/3904218 to your computer and use it in GitHub Desktop.
Save ThiefMaster/3904218 to your computer and use it in GitHub Desktop.
php is even more crappy than i thought
<?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
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