#40941 [Fbk->Csd]: Segfault with Reflection and undeclared class properties

From: Date: Fri, 30 Mar 2007 00:32:41 +0000
Subject: #40941 [Fbk->Csd]: Segfault with Reflection and undeclared class properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110946@lists.php.net to get a copy of this message
ID: 40941 User updated by: daniel dot oconnor at gmail dot com Reported By: daniel dot oconnor at gmail dot com -Status: Feedback +Status: Closed Bug Type: Reproducible crash Operating System: Ubuntu (fiesty) PHP Version: 5.2.1 New Comment: Works For Me, CVS Previous Comments: ------------------------------------------------------------------------ [2007-03-29 08:14:16] 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-29 05:15:14] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40941&edit=1

« previous php.bugs (#110946) next »