3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $labels='blaat'; function loadDatabaseLabels($labels){ $labels->labels = array("foo","bar","baz"); return $labels; } function getLabel($labels){ var_dump($labels->label); } $labels = loadDatabaseLabels($labels); getLabel($labels);
Output for 7.2.0
Warning: Attempt to assign property 'labels' of non-object in /in/1gcfY on line 5 Notice: Trying to get property 'label' of non-object in /in/1gcfY on line 10 NULL
Output for 5.0.0 - 7.1.7
Warning: Attempt to assign property of non-object in /in/1gcfY on line 5 Notice: Trying to get property of non-object in /in/1gcfY on line 10 NULL
Output for 4.3.0 - 4.4.9
NULL