ID:               41729
 Updated by:       [EMAIL PROTECTED]
 Reported By:      degaulle13 at virgilio dot it
-Status:           Open
+Status:           Bogus
 Bug Type:         Documentation problem
 Operating System: Windows XP Pro SP2
 PHP Version:      Irrelevant
 New Comment:

The code is wrong even if it issues only E_NOTICE.


Previous Comments:
------------------------------------------------------------------------

[2007-06-18 15:06:53] degaulle13 at virgilio dot it

Description:
------------
I am an Italian, excused for errors in the translation.

In the Documentation -> Cap.12 Variables -> Basic is written: 

"One important thing to note is that only named variables may be
assigned by reference."

<?php
...
error_reporting(E_ALL);
function test()
{
   return 25;
}
$bar = &test();    // Invalid.
?>  

But to me, this code works. In fact, if I insert the row
"error_reporting(E_ALL);" they give to a Notice but not an error to me.

Output:
Notice: Only variables should be assigned by reference in
C:\www\index.php on line 9
25 

Hello.



Reproduce code:
---------------
<?php
...
error_reporting(E_ALL);
function test()
{
   return 25;
}
$bar = &test();    // Invalid.
?>  


Expected result:
----------------
Parse Error....

Actual result:
--------------
Notice: Only variables should be assigned by reference in
C:\www\index.php on line 9
25 



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41729&edit=1

Reply via email to