3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = null; $c = ''; print $a ?? 'b'; print "\n"; print $a ?: 'b'; print "\n"; print $c ?? 'a'; print "\n"; print $c ?: 'a'; print "\n"; $b = array('a' => null); print $b['a'] ?? 'd'; print "\n"; print $b['a'] ?: 'd'; print "\n"; print $b['c'] ?? 'e'; print "\n"; print $b['c'] ?: 'e'; print "\n";
based on 6nH50
Output for 7.0.0 - 7.3.0rc3
b b a d d e Notice: Undefined index: c in /in/YAXZs on line 29 e
Output for 5.5.0 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/YAXZs on line 6
Process exited with code 255.