|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-07-17 16:51 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 16:00:01 2025 UTC |
Actually I'm concerned that reset( (get_array()) ); does _not_ give a fatal error. This contradicts the last comment "There's really no way to get around that [getting a fatal error]". Why does it not give a fatal error? There is no variable.