3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test() { echo '1' . (yield 1) . '|'; echo '2' . (yield 2). '|'; } $val = test(); $val->rewind() var_dump($val->current()); //$val->next(); //var_dump($val->current()); //$val->send('ok'); //echo "|" . $val->current() . "|"; //$val->send('yes'); //echo "|" . $val->current() . "|"; //$val->next(); //$val->current(); //$val->send('no'); //echo "|" . $val->current() . "|";
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '1' (T_LNUMBER) in /in/Evpb7 on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_LNUMBER in /in/Evpb7 on line 5
Process exited with code 255.