3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function gen1() { yield 1; yield 2; yield 3; } function wat($iter) { var_dump($iter->valid()); } wat(gen1()); wat([4, 5, 6]);
Output for 7.0.0 - 7.2.0
bool(true) Fatal error: Uncaught Error: Call to a member function valid() on array in /in/cKFtj:10 Stack trace: #0 /in/cKFtj(14): wat(Array) #1 {main} thrown in /in/cKFtj on line 10
Process exited with code 255.
Output for 5.6.7 - 5.6.28
bool(true) Fatal error: Call to a member function valid() on array in /in/cKFtj on line 10
Process exited with code 255.
Output for 5.5.24 - 5.5.35
bool(true) Fatal error: Call to a member function valid() on a non-object in /in/cKFtj on line 10
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected '1' (T_LNUMBER) in /in/cKFtj on line 4
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_LNUMBER in /in/cKFtj on line 4
Process exited with code 255.