php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40941 Segfault with Reflection and undeclared class properties
Submitted: 2007-03-29 05:15 UTC Modified: 2007-03-30 00:32 UTC
From: daniel dot oconnor at gmail dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.2.1 OS: Ubuntu (fiesty)
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: daniel dot oconnor at gmail dot com
New email:
PHP Version: OS:

 

 [2007-03-29 05:15 UTC] daniel dot oconnor at gmail dot com
Description:
------------
Segfaults happen when you put something into a class property you haven't declared.

Probably a dupe of 40460, 40431; but affecting 5.2.1

Reproduce code:
---------------
<?php
class Example {
    public function segfault() {
        $class = new ReflectionObject($this);
        $properties = $class->getProperties();

        foreach ($properties as $property) {
            //Kaboom!
            if ($property->isStatic()) { continue; }
        }
        return true;
    }

    public function __construct($jr_id = null) {
        $this->d = "";
    }

}
$report = new Example();
$report->segfault();


Expected result:
----------------
No segfault.
Warnings about undeclared stuff.

Actual result:
--------------
Segmentation fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-29 08:14 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-03-30 00:32 UTC] daniel dot oconnor at gmail dot com
Works For Me, CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 10 12:01:33 2025 UTC