Bug #73067 [ReO->Csd]: __debugInfo crashes when throwing an exception

From: Date: Tue, 11 Oct 2016 23:52:09 +0000
Subject: Bug #73067 [ReO->Csd]: __debugInfo crashes when throwing an exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204613@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73067&edit=1 ID: 73067 Updated by: stas@php.net Reported by: martin dot smeeckaert at gmail dot com Summary: __debugInfo crashes when throwing an exception -Status: Re-Opened +Status: Closed Type: Bug Package: Reproducible crash Operating System: Ubuntu 16.04 PHP Version: 7.0.10 Block user comment: N Private report: N New Comment: Automatic comment on behalf of ab Revision: http://git.php.net/?p=php-src.git;a=commit;h=8c9f639a1df068976a841e9b5624d2f5d5d9c7c7 Log: Revert &quot;Fixed bug #73067 (__debugInfo crashes when throwing an exception)&quot; Previous Comments: ------------------------------------------------------------------------ [2016-10-11 10:48:57] derick@php.net The original fix broke expected behaviour in PHP. Discussion at http://news.php.net/php.internals/96304 ------------------------------------------------------------------------ [2016-10-11 09:31:15] ab@php.net Automatic comment on behalf of ab Revision: http://git.php.net/?p=php-src.git;a=commit;h=8c9f639a1df068976a841e9b5624d2f5d5d9c7c7 Log: Revert &quot;Fixed bug #73067 (__debugInfo crashes when throwing an exception)&quot; ------------------------------------------------------------------------ [2016-09-13 02:59:49] laruence@php.net Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d8ab51576695630a7471ff829cc5ea10becdc0f Log: Fixed bug #73067 (__debugInfo crashes when throwing an exception) ------------------------------------------------------------------------ [2016-09-12 15:37:25] martin dot smeeckaert at gmail dot com Description: ------------ I'm using php 7.0.8 on Ubuntu 16.04 and I came across a strange bug, if an exception is thrown in the __debugInfo call, it will result in a fatal error no matter what you do. PHP expect __debugInfo to return an array but it is impossible because of the exception. Test script: --------------- <?php class Debug { public function __debugInfo() { throw new Exception("Test Crash"); } } try { var_dump(new Debug()); } catch (Exception $e) { echo $e->getMessage(); } Expected result: ---------------- > "Test Crash" Actual result: -------------- PHP Warning: Uncaught Exception: Test Crash in .../BugDebugInfo.php:7 Stack trace: #0 [internal function]: Debug->__debugInfo() #1 .../BugDebugInfo.php(12): var_dump(Object(Debug)) #2 {main} thrown in .../BugDebugInfo.php on line 7 PHP Fatal error: __debuginfo() must return an array in .../BugDebugInfo.php on line 12 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73067&edit=1

« previous php.bugs (#204613) next »