3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = (object) array(1,2,3,4); var_dump($s); foreach($s as $ass) { echo $ass . PHP_EOL; }
Output for 5.2.1 - 7.1.0
object(stdClass)#1 (4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) } 1 2 3 4
Output for 5.2.0
object(stdClass)#1 (4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Process exited with code 139.
Output for 5.0.0 - 5.1.6
object(stdClass)#1 (4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for 4.3.10 - 4.4.9
object(stdClass)(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) } 1 2 3 4
Output for 4.3.0 - 4.3.9
object(stdClass)(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) } Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/1erjR on line 8 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/1erjR on line 8 2PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/1erjR on line 8 3PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/1erjR on line 8 4PHP_EOL