Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ext/spl/spl_dllist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions ext/spl/spl_observer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
27 changes: 27 additions & 0 deletions ext/spl/tests/bug69264.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--TEST--
Bug #69264 (__debugInfo() ignored while extending SPL classes)
--FILE--
<?php
class foo extends SplStack {
public function __debugInfo() { return ['foo']; }
}

class bar extends foo {
public function __debugInfo() { return ['bar']; }
}

class bar2 extends SplObjectStorage {
public function __debugInfo() { return ['bar2']; }
}

var_dump((new bar), (new bar2));
?>
--EXPECTF--
object(bar)#%d (1) {
[0]=>
string(3) "bar"
}
object(bar2)#%d (1) {
[0]=>
string(4) "bar2"
}