php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34462 isset($this->$x) no longer works when $x not set with PHP 5.05
Submitted: 2005-09-11 14:36 UTC Modified: 2005-09-12 00:32 UTC
From: bduclaux at yahoo dot com Assigned:
Status: Closed Package: Class/Object related
PHP Version: 5.0.5 OS: Fedora Core 4
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: bduclaux at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-09-11 14:36 UTC] bduclaux at yahoo dot com
Description:
------------
PHP 5.05 modifies the handling of isset($this->$x) when $x is not set.

This breaks many existing scripts, and is not properly documented IMHO.

Reproduce code:
---------------
<?php
        class A {
                function A() {
                        $x='';
                        var_dump(isset($this->$x));
                        }
        }

        new A();
?>

With php 5.05 :
Fatal error: Cannot access empty property in /home/sysop/test.php on line 5

With php 5.04:
bool(false)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-12 00:32 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Works fine with PHP 5.1-dev.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 21 13:00:02 2025 UTC