Skip to content

Instantly share code, notes, and snippets.

@co3k
Created October 20, 2009 08:44
Show Gist options
  • Save co3k/214116 to your computer and use it in GitHub Desktop.
Save co3k/214116 to your computer and use it in GitHub Desktop.
php の call time pass by reference を見る奴
<?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