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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Fri Sep 25 19:01:24 2020 UTC