|
Posted by Oli Filth on 11/18/58 11:44
Oli Filth said the following on 09/04/2006 13:44:
> Jerry Stuckle said the following on 09/04/2006 06:14:
>> Oli Filth wrote:
>>> I have error level set to E_ALL | E_STRICT. The following code
>>> executes fine:
>>> <?php
>>>
>>> function getValueWithDefault(&$array, $key, $default = NULL)
>>> {
>>> return (isset($array[$key])) ? $array[$key] : $default;
>>> }
>>>
>>> $var = array();
>>> echo getValueWithDefault($var, "Roger", "Dodger") . "\n";
>>>
>>> ?>
>> Take out the $var=array() line and see what you get.
>
> But anyway, removing the $var = array() line does not result in any
> error/warning. Because it's being passed by reference, PHP
> automatically creates a variable $var in the global scope
That should be *caller* scope...
--
Oli
[Back to original message]
|