3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $a = 'test'; } class B extends A { protected $b = ['id' => 1]; } $b = new B(); var_dump(reset($b));
Output for 8.1.0 - 8.1.9
Deprecated: reset(): Calling reset() on an object is deprecated in /in/hnVHQ on line 13 string(4) "test"
Output for 7.4.0 - 7.4.30, 8.0.1 - 8.0.22
array(1) { ["id"]=> int(1) }

preferences:
41.27 ms | 410 KiB | 5 Q