Hey,
<?php
error_reporting(E_ALL);
echo $$foo;
?>
results in
Notice: Undefined variable: foo in /foo/bar.php on line 4
Notice: Undefined variable: in /foo/bar.php on line 4
Wouldn't it be more appropriate if the second notice was something like
"Notice: Undefined variable: <unnamed> in /foo/bar.php on line 4"?
--
- Martin Martin Jansen
http://martinjansen.com/
Martin Jansen wrote:
Hey,
<?php error_reporting(E_ALL); echo $$foo; ?>
results in
Notice: Undefined variable: foo in /foo/bar.php on line 4 Notice: Undefined variable: in /foo/bar.php on line 4
Wouldn't it be more appropriate if the second notice was something like
"Notice: Undefined variable: <unnamed> in /foo/bar.php on line 4"?
i'd prefere to put the variable name in single quotes here
as the name actually is '' (empty string)
<?php
$foo = "";
$$foo = "hallo";
echo ${""};
?>
--
Hartmut Holzgraefe <hartmut@php.net
Hey,
<?php error_reporting(E_ALL); echo $$foo; ?>
results in
Notice: Undefined variable: foo in /foo/bar.php on line 4 Notice: Undefined variable: in /foo/bar.php on line 4
Wouldn't it be more appropriate if the second notice was something like
"Notice: Undefined variable: <unnamed> in /foo/bar.php on line 4"?
Would be a lie... $foo WILL evaluate to the empty string which used like
this, although it does look weird, it is right :)
Derick