3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = []; $age = $data['people'][0]['age'] ?? 10; print_r($age); $data = [ 'people' => [ [ 'age' => 12 ] ] ]; $age = $data['people'][0]['age'] ?? 10; print_r($age);
based on BFDEY
Output for 7.0.0 - 7.2.0
1012
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/KYKff on line 4
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/KYKff on line 3
Process exited with code 255.