|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-02-06 03:33 UTC] sven at democopei dot de
Description:
------------
For some reason I cannot figure out, array() doesn't give me an empty array anymore but NULL.
(References are used for good reasons, btw.)
Test script:
---------------
function &foo_to_array (&$x)
{
$array_to_return = array (); // Works the first couple of times, then NULLs.
// add foo elements to array
return $array_to_return;
}
Introducing some wrapper doesn't help either -- an array is actually created but NULL is returned anyway:
function make_array ()
{
return array ();
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
I cannot reproduce this with the code below. Are you running some extension like APC or Zend Guard that mangles/optimizes the code for you? <?php function &foo_to_array (&$x) { $array_to_return = array(); return $array_to_return; } $x = ""; var_dump(foo_to_array($x));