From: daniel dot oconnor at gmail dot com
Operating system: Ubuntu (fiesty)
PHP version: 5.2.1
PHP Bug Type: Reproducible crash
Bug description: Segfault with Reflection and undeclared class properties
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
--
Edit bug report at http://bugs.php.net/?id=40941&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=40941&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=40941&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=40941&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40941&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=40941&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40941&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40941&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40941&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40941&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40941&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=40941&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=40941&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40941&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40941&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40941&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40941&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40941&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40941&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40941&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40941&r=mysqlcfg