Created
October 20, 2009 08:44
-
-
Save co3k/214116 to your computer and use it in GitHub Desktop.
php の call time pass by reference を見る奴
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 'PHP Version: '.phpversion().PHP_EOL; | |
echo 'allow_call_time_pass_reference: '.(int)ini_get('allow_call_time_pass_reference').PHP_EOL; | |
echo '============================='.PHP_EOL.PHP_EOL; | |
function ref(&$arg) | |
{ | |
$arg = 'kani'; | |
} | |
$ebi = 'ebi'; | |
ref($ebi); | |
var_dump($ebi); | |
$ebi = 'ebi'; | |
call_user_func('ref', $ebi); | |
var_dump($ebi); | |
$ebi = 'ebi'; | |
call_user_func('ref', &$ebi); | |
var_dump($ebi); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment