|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-07-12 15:22 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2016-07-12 15:22 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 09:00:01 2025 UTC |
Description: ------------ It seems that if an Exception object is serialized and unserialized, the resulting object does not have the private "previous" property set correctly. Invoking the __toString method on the resulting object generates a PHP Notice. Test script: --------------- <?php $e1 = new Exception("Test"); $e2 = unserialize( serialize( $e1 ) ); echo $e2->__toString() . "\n"; ?> Expected result: ---------------- exception 'Exception' with message 'Test' in /home/...php:2 Stack trace: #0 {main} Actual result: -------------- PHP Notice: Undefined property: Exception::$previous in /home/...php on line 4 PHP Stack trace: PHP 1. {main}() /home/...php:0 PHP 2. Exception->__toString() /home/...php:4 exception 'Exception' with message 'Test' in /home/...php:2 Stack trace: #0 {main}