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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sun Dec 22 02:01:28 2024 UTC