php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16528 Incompatible behaviour of arrays (and maybe other vars)
Submitted: 2002-04-10 06:05 UTC Modified: 2002-04-10 06:26 UTC
From: ssilk at fidion dot de Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.1.2 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ssilk at fidion dot de
New email:
PHP Version: OS:

 

 [2002-04-10 06:05 UTC] ssilk at fidion dot de
In PHP 4.0 you can write the following:

...
$a='';
if ( empty($a['bla']) )
...

There are no errors or warnings, even if all warnings has been put on (as we do).

in PHP 4.1 this code complains the missing index 'bla':
Warning: Uninitialized string offset: 0 in  ....

Workarround:

if ( empty($a) and empty($a['bla']) ) ....

which seems not to be very logical. $a['bla'] must be empty, if $a is empty...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-10 06:21 UTC] sander@php.net
Can you try 4.2.0RC2 or 3 from www.php.net/~derick?
 [2002-04-10 06:26 UTC] derick@php.net
This is not a bug. Please double-check the documentation available
at http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 18:01:28 2024 UTC