3v4l.org

run code in 500+ PHP versions simultaneously
<?php echo $foo; class testing { public $prop = 'property'; } $t = new testing(); echo "Normal prop: ".$t->prop."\n"; echo "Dynamic prop: ".$t->prop2."\n"; $t->prop2 = 'dynamic prop'; echo "Dynamic prop: ".$t->prop2."\n";
Output for 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Warning: Undefined variable $foo in /in/dgOYV on line 3 Normal prop: property Warning: Undefined property: testing::$prop2 in /in/dgOYV on line 11 Dynamic prop: Deprecated: Creation of dynamic property testing::$prop2 is deprecated in /in/dgOYV on line 12 Dynamic prop: dynamic prop
Output for 8.1.0 - 8.1.34
Warning: Undefined variable $foo in /in/dgOYV on line 3 Normal prop: property Warning: Undefined property: testing::$prop2 in /in/dgOYV on line 11 Dynamic prop: Dynamic prop: dynamic prop

preferences:
76.18 ms | 1009 KiB | 4 Q