为什么PHP不能将尖头值保留为全局变量?
<?php
$a = array();
$a[] = 'works';
function myfunc () {
global $a, $b ,$c;
$b = $a[0];
$c = &$a[0];
}
myfunc();
echo ' $b '.$b; //works
echo ', $c '.$c; //fails
?>
Run Code Online (Sandbox Code Playgroud)