3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $users = array(array('name' => 'a'), array('name' => 'b'), array('name' => 'c'), array('name' => 'd'), array('name' => 'e'), array('name' => 'f'), array('name' => 'g') ); function userNames($users) { foreach($users as $user) { yield $user['name']; } } $start = microtime(true) . PHP_EOL; foreach(userNames($users) as $name) { echo $name . PHP_EOL; } echo microtime(true) - $start;
Output for 7.1.0
a b c d e f g Notice: A non well formed numeric value encountered in /in/qjvFQ on line 27 2.4080276489258E-5
Output for 7.0.14
a b c d e f g 7.5101852416992E-5
Output for 7.0.7
a b c d e f g 5.9604644775391E-6
Output for 7.0.6
a b c d e f g -9.0599060058594E-6
Output for 5.6.15, 7.0.5
a b c d e f g 4.1007995605469E-5
Output for 5.5.10, 7.0.3 - 7.0.4
a b c d e f g 2.0980834960938E-5
Output for 7.0.2
a b c d e f g -1.5974044799805E-5
Output for 5.5.22, 7.0.1
a b c d e f g 4.2915344238281E-5
Output for 5.6.0, 7.0.0
a b c d e f g 7.3909759521484E-5
Output for 5.5.36, hhvm-3.12.0
a b c d e f g 4.3869018554688E-5
Output for hhvm-3.10.0
a b c d e f g 0.00010108947753906
Output for 5.6.28
a b c d e f g 9.2029571533203E-5
Output for 5.6.22
a b c d e f g 7.4863433837891E-5
Output for 5.6.21
a b c d e f g 5.2928924560547E-5
Output for 5.6.20
a b c d e f g 6.2942504882812E-5
Output for 5.6.19
a b c d e f g 2.288818359375E-5
Output for 5.5.18, 5.6.18
a b c d e f g 9.0599060058594E-6
Output for 5.6.17
a b c d e f g 2.598762512207E-5
Output for 5.5.15, 5.6.3, 5.6.16
a b c d e f g -5.0067901611328E-6
Output for 5.6.14
a b c d e f g 7.7009201049805E-5
Output for 5.6.13
a b c d e f g 4.0054321289062E-5
Output for 5.5.24, 5.6.12
a b c d e f g 5.1021575927734E-5
Output for 5.6.11
a b c d e f g 5.0067901611328E-6
Output for 5.6.10
a b c d e f g 7.6055526733398E-5
Output for 5.6.9
a b c d e f g 8.1062316894531E-6
Output for 5.5.32, 5.6.8
a b c d e f g 3.0040740966797E-5
Output for 5.6.7
a b c d e f g 1.1920928955078E-6
Output for 5.6.6
a b c d e f g 6.3896179199219E-5
Output for 5.6.5
a b c d e f g 3.504753112793E-5
Output for 5.6.4
a b c d e f g 6.103515625E-5
Output for 5.6.2
a b c d e f g 1.0967254638672E-5
Output for 5.5.3, 5.6.1
a b c d e f g 4.6014785766602E-5
Output for 5.5.35
a b c d e f g 1.9073486328125E-6
Output for 5.5.34
a b c d e f g 1.0013580322266E-5
Output for 5.5.33
a b c d e f g 7.7962875366211E-5
Output for 5.5.31
a b c d e f g 1.7166137695312E-5
Output for 5.5.30
a b c d e f g 9.9897384643555E-5
Output for 5.5.29
a b c d e f g 8.7976455688477E-5
Output for 5.5.28
a b c d e f g 1.7881393432617E-5
Output for 5.5.27
a b c d e f g 6.0796737670898E-5
Output for 5.5.26
a b c d e f g -1.6212463378906E-5
Output for 5.5.25
a b c d e f g 5.9843063354492E-5
Output for 5.5.20, 5.5.23
a b c d e f g 4.57763671875E-5
Output for 5.5.21
a b c d e f g 3.3140182495117E-5
Output for 5.5.19
a b c d e f g -3.0994415283203E-6
Output for 5.5.16
a b c d e f g 5.6982040405273E-5
Output for 5.5.14
a b c d e f g 4.5061111450195E-5
Output for 5.5.13
a b c d e f g -6.9141387939453E-6
Output for 5.5.12
a b c d e f g -1.9073486328125E-6
Output for 5.5.11
a b c d e f g 4.887580871582E-5
Output for 5.5.9
a b c d e f g 9.3936920166016E-5
Output for 5.5.5, 5.5.8
a b c d e f g 4.7922134399414E-5
Output for 5.5.7
a b c d e f g 6.7949295043945E-5
Output for 5.5.6
a b c d e f g 4.0531158447266E-6
Output for 5.5.4
a b c d e f g 9.2983245849609E-5
Output for 5.5.2
a b c d e f g 3.6001205444336E-5
Output for 5.5.1
a b c d e f g 0
Output for 5.5.0
a b c d e f g 1.8835067749023E-5
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected '$user' (T_VARIABLE) in /in/qjvFQ on line 16
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE in /in/qjvFQ on line 16
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_VARIABLE in /in/qjvFQ on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/qjvFQ on line 16
Process exited with code 255.