Bug #69249 [Opn->Csd]: ReflectionProperty::getDocComment() non catchable fatal

From: Date: Mon, 02 Jul 2018 18:21:36 +0000
Subject: Bug #69249 [Opn->Csd]: ReflectionProperty::getDocComment() non catchable fatal
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216077@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69249&edit=1 ID: 69249 Updated by: nikic@php.net Reported by: bkfake-php at yahoo dot com Summary: ReflectionProperty::getDocComment() non catchable fatal -Status: Open +Status: Closed Type: Bug Package: Reflection related Operating System: Win7 x64 PHP Version: 5.6.7 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: Can't reproduce this on any supported PHP version (getDocComment() returns false), so I'm assuming this is fixed. Previous Comments: ------------------------------------------------------------------------ [2015-03-24 17:07:10] bkfake-php at yahoo dot com let me know if this isn't the backtrace information you're looking for In httpd__PID__3192__Date__03_24_2015__Time_11_51_07AM__420__Second_Chance_Exception_C0000005.dmp the assembly instruction at msvcr110!memcpy+21e in C:\Windows\System32\msvcr110.dll from Microsoft Corporation has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 64 here's thread 64 Thread 64 - System ID 8012 Entry point libhttpd!ap_regkey_value_set+1bf0 Create time 3/24/2015 11:43:25 AM Time spent in user mode 0 Days 00:00:00.000 Time spent in kernel mode 0 Days 00:00:00.000 This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required. Function msvcr110!memcpy+21e php5ts!estrndup+30 php5ts!zend_reflection_class_factory+b50f php5ts!execute_ex+cb1 php5ts!instanceof_function+3c7 php5ts!execute_ex+3b4 php5ts!zend_execute+22c php5ts!zend_execute+1ca php5ts!zend_execute_scripts+14b php5ts!php_execute_script+1b4 ------------------------------------------------------------------------ [2015-03-18 02:50:56] laruence@php.net 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 for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 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. ------------------------------------------------------------------------ [2015-03-17 15:03:36] bkfake-php at yahoo dot com Description: ------------ Calling ReflectionProperty::getDocComment() on a property that hasn't been declared in the class "core dumps". Simply returning null, false, or an empty string would be much more user friendly To safely call ReflectionProperty::getDocComment(), you must first check if the property exists in the class $docComment = property_exists('Test', $prop->getName()) ? $prop->getDocComment() : ''; Test script: --------------- $obj = new Test(); $obj->notDeclared = 'Not defined in class'; $reflectionObject = new \ReflectionObject($obj); $properties = $reflectionObject->getProperties(); while ($properties) { $prop = array_shift($properties); $prop->getDocComment(); } /** * Test */ class Test { // properties and methods... } Expected result: ---------------- script completes Actual result: -------------- Apache restarts ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69249&edit=1

« previous php.bugs (#216077) next »