3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = new class { private $a = 3; protected $b = 2; public $c = 1; }; $arr = (array)$foo; var_dump($arr); var_dump(array_keys($arr)[0][0]);
Output for 7.2.0
array(3) { ["class@anonymous/in/sks4C0x7fce39afe04ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.1.10
array(3) { ["class@anonymous/in/sks4C0x7f9c5687304ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.1.7
array(3) { ["class@anonymous/in/sks4C0x7f4b0c32704ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.1.6
array(3) { ["class@anonymous/in/sks4C0x7fb9e07fb04ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.1.5
array(3) { ["class@anonymous/in/sks4C0x7f08142cf04ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.1.0
array(3) { ["class@anonymous/in/sks4C0x7f4b0e37704ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.20
array(3) { ["class@anonymous/in/sks4C0x7f8fb13b004ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.6
array(3) { ["class@anonymous/in/sks4C0x7fa6f223404ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.5
array(3) { ["class@anonymous/in/sks4C0x7f3c741cf04ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.4
array(3) { ["class@anonymous/in/sks4C0x7f933034104ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.3
array(3) { ["class@anonymous/in/sks4C0x7f8c54b9704ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.2
array(3) { ["class@anonymous/in/sks4C0x7f07ea40904ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.1
array(3) { ["class@anonymous/in/sks4C0x7fd99bc6004ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 7.0.0
array(3) { ["class@anonymous/in/sks4C0x7fbcddddf04ba"]=> int(3) ["*b"]=> int(2) ["c"]=> int(1) } string(1) ""
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/sks4C on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/sks4C on line 3
Process exited with code 255.