Bug #55222 [Opn]: Fatal Error disappears when using paranthesis

From: Date: Sun, 17 Jul 2011 20:52:26 +0000
Subject: Bug #55222 [Opn]: Fatal Error disappears when using paranthesis
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161946@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55222&edit=1

 ID:                 55222
 User updated by:    hanskrentel at yahoo dot de
 Reported by:        hanskrentel at yahoo dot de
 Summary:            Fatal Error disappears when using paranthesis
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

within = without in the description.


Previous Comments:
------------------------------------------------------------------------
[2011-07-17 16:51:34] hanskrentel at yahoo dot de

Description:
------------
PHP 5.3 is giving me nice, sound FATAL ERRORS when using functions like reset() within a variable.
However it looks like that it's not always taken care of that consequentially.

I don't even get a strict standards warning even.

Test script:
---------------
<?php
error_reporting(~0);

function get_array() {
   return Array(1);
}

function foo() {
   // return reset( (get_array()?:null) );
   //               ^Fatal error: Only variables can be passed by reference
   return reset( (get_array()) ); 
  //             ^Only? This one works OK
}

foo();


Expected result:
----------------
Fatat error.

Actual result:
--------------
All fine.


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



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


Thread (11 messages)

« previous php.bugs (#161946) next »