3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = range(0, 1440); $it = new CallbackFilterIterator( new ArrayIterator($array), function($value, $key) { return 0 === $key % 30; } ); foreach ($it as $value) { var_dump($value); }
Output for 5.4.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
int(0) int(30) int(60) int(90) int(120) int(150) int(180) int(210) int(240) int(270) int(300) int(330) int(360) int(390) int(420) int(450) int(480) int(510) int(540) int(570) int(600) int(630) int(660) int(690) int(720) int(750) int(780) int(810) int(840) int(870) int(900) int(930) int(960) int(990) int(1020) int(1050) int(1080) int(1110) int(1140) int(1170) int(1200) int(1230) int(1260) int(1290) int(1320) int(1350) int(1380) int(1410) int(1440)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0 - 5.3.29
Fatal error: Class 'CallbackFilterIterator' not found in /in/msXK3 on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/msXK3 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/msXK3 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/msXK3 on line 6
Process exited with code 255.