php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15825 isset() raises warning for undefined class property
Submitted: 2002-03-01 22:32 UTC Modified: 2002-03-02 06:42 UTC
From: yohgaki@php.net Assigned:
Status: Closed Package: Variables related
PHP Version: 4.0CVS-2002-03-0 OS: ANY
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: yohgaki@php.net
New email:
PHP Version: OS:

 

 [2002-03-01 22:32 UTC] yohgaki@php.net
4.0..x does not raise error, but 4.1.x does.

<?php
error_reporting(E_ALL);
class testclass { var $dd = ""; }
$test = new testclass();
if (isset($test->dd[0])){
    echo "(A) TRUE \n";
}else{
    echo "(A) FALSE \n";
}
if (is_array($test->dd) && isset($test->dd[0])){
    echo "(B) TRUE \n";
}else{
    echo "(B) FALSE \n";
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-01 22:32 UTC] yohgaki@php.net
Should be fixed before 4.2.0, IMO
 [2002-03-02 06:04 UTC] derick@php.net
There is nothing wrong here, it prints "PHP Notice:  Uninitialized string offset:  0 in - on line 5" for me, which it should.

Derick
 [2002-03-02 06:42 UTC] yohgaki@php.net
I confirmed it also. It seems andrei's patch fixed this somehow.




 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC