3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $values = range( 0 , 10000000) ; $sum = 0 ; function generator( $range ){ foreach( $range as $value ){ yield $value ; } } $data = generator( $values ) ; $sum =0 ; foreach( $data as $el ){ $sum += $el ; } echo $sum ;
based on NEvjU
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 536870920 bytes) in /in/sLN5E on line 3
Process exited with code 255.
Output for hhvm-3.12.14 - 3.17.3
Fatal error: request has exceeded memory limit in /in/sLN5E on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/sLN5E on line 3
Process exited with code 255.