diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 9919b1aa63898..7dd68af648d61 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -500,6 +500,11 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp) /* { zend_string *pnstr; int i = 0; HashTable *debug_info; + + if (Z_OBJCE_P(obj)->__debugInfo) { + return zend_std_get_debug_info(obj, is_temp); + } + *is_temp = 1; if (!intern->std.properties) { diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index c58a387e4c2b7..d35af8e2da854 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -289,6 +289,10 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp) /* {{{ zend_string *zname; HashTable *debug_info; + if (Z_OBJCE_P(obj)->__debugInfo) { + return zend_std_get_debug_info(obj, is_temp); + } + *is_temp = 1; props = Z_OBJPROP_P(obj); diff --git a/ext/spl/tests/bug69264.phpt b/ext/spl/tests/bug69264.phpt new file mode 100644 index 0000000000000..e29433e002387 --- /dev/null +++ b/ext/spl/tests/bug69264.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #69264 (__debugInfo() ignored while extending SPL classes) +--FILE-- + +--EXPECTF-- +object(bar)#%d (1) { + [0]=> + string(3) "bar" +} +object(bar2)#%d (1) { + [0]=> + string(4) "bar2" +}