3v4l.org

run code in 200+ PHP versions simultaneously
<?php //creating $arr = ['name' => "Jasein"]; $arrOldWay = array('name' => "Jasein");//same thing as above class Blah{ public $name = 'Jasein'; } $obj = new Blah(); //accessing echo $arr ['name'] . "\n"; echo $arrOldWay ['name'] . "\n"; echo $obj->name . "\n";
Output for 7.1.25 - 7.3.3
Jasein Jasein Jasein