3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass{ public int $id; } class MyClass2{ public $id; } class MyClass3{ public int $id = 1; } $object = new MyClass(); $object2 = new MyClass2(); $object3 = new MyClass3(); var_dump(get_object_vars($object)); var_dump(get_object_vars($object2)); var_dump(get_object_vars($object3)); var_dump($object->id);
Output for git.master, git.master_jit, rfc.property-hooks
array(0) { } array(1) { ["id"]=> NULL } array(1) { ["id"]=> int(1) } Fatal error: Uncaught Error: Typed property MyClass::$id must not be accessed before initialization in /in/uOfF5:22 Stack trace: #0 {main} thrown in /in/uOfF5 on line 22
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
66.86 ms | 401 KiB | 8 Q