Bug #53936 [Fbk->Opn]: Literal empty array returns NULL.
| From: | sven at democopei dot de | Date: | Mon, 07 Feb 2011 16:49:52 +0000 |
| Subject: | Bug #53936 [Fbk->Opn]: Literal empty array returns NULL. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158559@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53936&edit=1
ID: 53936
User updated by: sven at democopei dot de
Reported by: sven at democopei dot de
Summary: Literal empty array returns NULL.
-Status: Feedback
+Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Linux
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
No, I'm sorry. I don't use any extensions or Zend. As I said, I cannot
boil this down to its essence - I have some very large, generated PHP
script I'm willing to send you via PM, though.
Previous Comments:
------------------------------------------------------------------------
[2011-02-07 10:54:54] mj@php.net
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));
------------------------------------------------------------------------
[2011-02-06 03:33:01] 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 ();
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53936&edit=1