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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 19:01:37 2025 UTC