3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __debugInfo(): array { return [ 'anything' => 'anything' ]; } } var_dump(new Foo());
based on Oj9Mh
Output for 7.1.25 - 7.1.32, 7.2.0 - 7.2.33, 7.3.0 - 7.3.23, 7.4.0 - 7.4.11, 8.0.0alpha1 - rc2
object(Foo)#1 (1) { ["anything"]=> string(8) "anything" }