#41729 [Opn->Bgs]: Cap.12 Variables - Basic

From: Date: Thu, 16 Aug 2007 14:22:11 +0000
Subject: #41729 [Opn->Bgs]: Cap.12 Variables - Basic
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969377438@lists.php.net to get a copy of this message
ID: 41729 Updated by: vrana@php.net 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

« previous php.doc (#969377438) next »