3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $labels='blaat'; function loadDatabaseLabels(){ $labels->labels = array("foo","bar","baz"); } function getLabel(){ var_dump($labels->label); } loadDatabaseLabels(); getLabel();
Output for 5.4.0 - 7.1.0
Warning: Creating default object from empty value in /in/qJ9i7 on line 4 Notice: Undefined variable: labels in /in/qJ9i7 on line 8 Notice: Trying to get property of non-object in /in/qJ9i7 on line 8 NULL
Output for 5.0.4 - 5.3.29
Strict Standards: Creating default object from empty value in /in/qJ9i7 on line 4 Notice: Undefined variable: labels in /in/qJ9i7 on line 8 Notice: Trying to get property of non-object in /in/qJ9i7 on line 8 NULL
Output for 5.0.0 - 5.0.3
Strict Standards: Creating default object from empty value in /in/qJ9i7 on line 4 Notice: Undefined variable: labels in /in/qJ9i7 on line 8 Notice: Trying to get property of non-object in /in/qJ9i7 on line 8 NULL
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: labels in /in/qJ9i7 on line 8 NULL