ID: 32981 Updated by: [EMAIL PROTECTED] Reported By: phpbug at swift-web dot com -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Gentoo 2.6.11 PHP Version: 5.0.5-dev New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. I can't reproduce it - neither with 5_0-dev nor 5.1-dev Previous Comments: ------------------------------------------------------------------------ [2005-05-09 22:19:07] phpbug at swift-web dot com Tried with the latest stable 5.0 (from the link you sent) and the page still crashes with seg fault error. The version reported in phpinfo is 5.0.5-dev from that install. ------------------------------------------------------------------------ [2005-05-09 11:36:40] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip Seems to work fine fore me with latest CVS HEAD (5.1-dev) but do try and see if it's fixed in the 5.0 too. ------------------------------------------------------------------------ [2005-05-09 10:15:43] phpbug at swift-web dot com Description: ------------ Discovered if I am using ReflectionMethod::getStaticVariables() on a method that has a static variable that is set to boolean true or false then php crashes (Apache 2 exists with following error) [notice] child pid 28346 exit signal Segmentation fault (11) I tried with php version 5.0.3 initially but upgraded to 5.0.4 and problem still exists. Reproduce code: --------------- class demo_class { static function myDemo($toggle) { static $enabled = true; // do whatever } } $class = new ReflectionClass('demo_class'); foreach ($class->getMethods() as $method) { $arr_static_vars[] = $method->getStaticVariables(); } echo "done"; // (normally would output $arr_static_var but just put above // line for simplicity in this example) Expected result: ---------------- See a screen with just the word 'done' on it Actual result: -------------- Page loading stops immediately (and keeps last page shown displayed. Apache logs show: [notice] child pid 28346 exit signal Segmentation fault (11) (pid of course varies) If I change the third line in my sample code to: static $enabled = 1; (or string) the page does not crash and things display properly I haven't tested this to see if it also crashes showing static variables for the entire class (as opposed to the one in the method) but if they inherit the same code I guess it would also crash but again I haven't confirmed that. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32981&edit=1