|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-01-09 16:22 UTC] zaq178miami at gmail dot com
[2016-07-19 15:10 UTC] bishop@php.net
-Summary: User __debugInfo method ignored
+Summary: User __debugInfo method ignored for internal
classes
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: bishop
[2017-10-24 06:04 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: bishop
+Assigned To:
[2018-08-13 08:01 UTC] zerterone at gmail dot com
[2018-08-13 08:04 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2018-08-13 08:04 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ When user class extends internal class with get_debug_info object handler set and defined userland __debugInfo() method, that method totally ignored. As a workaround, Z_OBJDEBUG macro may be changed to looks like #define Z_OBJDEBUG(zval,tmp) (Z_OBJCE(zval)->__debugInfo?std_object_handlers.get_debug_info(&(zval),&tmp):(Z_OBJ_HANDLER((zval),get_debug_info)?Z_OBJ_HANDLER((zval),get_debug_info)(&(zval),&tmp):(tmp=0,Z_OBJ_HANDLER((zval),get_properties)?Z_OBJPROP(zval):NULL))) From Bob Weinand notes: Then comes a question about parent::__debugInfo() in userland __debugInfo() comes: should it be accessible? Should it return what get_debug_info returns? Or should get_debug_info moved to ce->__debugInfo (internally too)? BC? Test script: --------------- class CustomSplStorage extends SplObjectStorage { public function __debugInfo() { return ['this is' => 'annoying']; } } var_dump(new CustomSplStorage()); debug_zval_dump(new CustomSplStorage()); Expected result: ---------------- object(CustomSplStorage)#1 (1) { ["this is"]=> string(8) "annoying" } object(CustomSplStorage)#1 (1) refcount(1){ ["storage":"SplObjectStorage":private]=> ["this is"]=> string(8) "annoying" refcount(2) } Actual result: -------------- object(CustomSplStorage)#1 (1) { ["storage":"SplObjectStorage":private]=> array(0) { } } object(CustomSplStorage)#1 (1) refcount(1){ ["storage":"SplObjectStorage":private]=> array(0) refcount(1){ } }