3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $item = [ 'id' => '123' ]; $item2 = [ 'id' => '000' ]; $counts = [ '111' => true, '123' => true, '234' => true, '345' => true, '456' => true, '567' => true, ]; var_dump($counts[$item['id']] ?? null); var_dump($counts[$item2['id']] ?? null);
based on nWRXS
Output for hhvm-3.22.0, 7.1.0 - 7.3.0beta1
bool(true) NULL
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '?' in /in/vaGtK on line 22
Process exited with code 255.