php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32020 NULL is saved as 0 in variables
Submitted: 2005-02-18 13:50 UTC Modified: 2005-02-23 09:19 UTC
From: dreeh at ets-online dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID: None
 [2005-02-18 13:50 UTC] dreeh at ets-online dot de
Description:
------------
when i assign NULL to a variable, it's saved as 0.
see my example...



Reproduce code:
---------------
$variable[0] = NULL;
$variable[1] = null;
$variable[2] = 0;
$variable[3] = "";

Expected result:
----------------
i'm expecting:

Array
(
    [0] => 
    [1] => 
    [2] => 0
    [3] => 
)

Actual result:
--------------
i'm getting this:

Array
(
    [0] => 0
    [1] => 
    [2] => 0
    [3] => 
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-18 14:14 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Can't reproduce.
 [2005-02-18 14:34 UTC] dreeh at ets-online dot de
i can reproduce it.

the problem ist only existent, if

- i run php with normal php-sourcecode files
- i run php with eaccelerator with (eaccelerator-encoded) php-compiled files

the problem is not repuducable, if

- i run php with eaccelerator and normal php-sourcecode files
 [2005-02-18 16:39 UTC] tony2001@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

That's eAccelerator bug and it has nothing to do with PHP itself.
 [2005-02-18 16:53 UTC] dreeh at ets-online dot de
no, the problem occurs when i comment the loading of the extension in the php.ini!

with loaded extension, the bug doesn't occur. see my last comment.
 [2005-02-20 18:30 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Unless you can demonstrate that the problem occurs with "stock' PHP without any extra extensions especially compiler related extnsion this is not a PHP bug.
 [2005-02-20 21:43 UTC] dreeh at ets-online dot de
the last time...the problem only occurs without any extensions.

i do not need any support, i'm reporting a bug.
 [2005-02-21 18:49 UTC] tony2001@php.net
We can't reproduce this behaviour without eAccelerator.
Please _check_ that you have not loaded any zend extensions (see `php -v` & phpinfo()).
 [2005-02-23 09:19 UTC] dreeh at ets-online dot de
denny@maggie:~> php -v
PHP 4.3.10 (cli) (built: Jan 21 2005 15:25:23)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


now, the problem don't occurs anymore.

i will reopen the bug if the error comes back.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 09:01:33 2025 UTC