3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $services = [ 'branch_delivery' => [ 'name' => $this->getOptionText('branch_delivery'), 'url' => 'info/trade-services/delivery', 'image' => 'assets/img/branch/icon-truck-delivery.png' ], 'timber_cutting' => [ 'name' => $this->getOptionText('timber_cutting'), 'url' => 'info/trade-services/timber-cutting', 'image' => 'assets/img/branch/icon-timber-cutting.png' ] ]; $options = []; foreach ($services as $service => $data) { $options[$service] = $data['name']; } print_r($options);
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught Error: Using $this when not in object context in /in/Uap8i:5 Stack trace: #0 {main} thrown in /in/Uap8i on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: $this is null in /in/Uap8i:5 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Using $this when not in object context in /in/Uap8i on line 5
Process exited with code 255.