3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function f() { $arr = [-1 => 'foo']; $a = yield -1; var_dump($arr[$a]); } $g = f(); foreach ($g as $i) { var_dump($i); }
based on DPXBe
Output for hhvm-3.15.4, 7.0.0 - 7.2.8
int(-1) Notice: Undefined index: in /in/ASBDk on line 6 NULL
Output for 5.6.0 - 5.6.30
NULL string(3) "foo"