3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $property_service_labels = ['Location']['MasterLocation']['PropertyService']; foreach($property_service_labels as $psl) { $psl_label = $psl['service_type_label']; } $this->set( 'PropertyServiceLabel', $psl_label[0]['service_type_label']);
based on 7OEsb
Output for 7.0.0 - 7.1.0
Notice: Undefined index: MasterLocation in /in/mbQJY on line 2 Warning: Invalid argument supplied for foreach() in /in/mbQJY on line 3 Fatal error: Uncaught Error: Using $this when not in object context in /in/mbQJY:6 Stack trace: #0 {main} thrown in /in/mbQJY on line 6
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Notice: Undefined index: MasterLocation in /in/mbQJY on line 2 Warning: Invalid argument supplied for foreach() in /in/mbQJY on line 3 Fatal error: Using $this when not in object context in /in/mbQJY on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.45
Parse error: syntax error, unexpected '[' in /in/mbQJY on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/mbQJY on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/mbQJY on line 2
Process exited with code 255.