3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new SplFileObject('http://www.stackoverflow.com/'); $norewind = new NoRewindIterator($obj); $caching = new CachingIterator($norewind); $limit = new LimitIterator($caching, 80, 30); foreach ($limit as $i => $line) { printf("%03d: %s", $i, $line); }
Output for 7.0.0 - 7.0.3, 7.0.5 - 7.1.0
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/PqvoK:3 Stack trace: #0 /in/PqvoK(3): SplFileObject->__construct('http://www.stac...') #1 {main} thrown in /in/PqvoK on line 3
Process exited with code 255.
Output for 7.0.4
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(): php_network_getaddresses: getaddrinfo failed: System error in /in/PqvoK:3 Stack trace: #0 /in/PqvoK(3): SplFileObject->__construct('http://www.stac...') #1 {main} thrown in /in/PqvoK on line 3
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(http://www.stackoverflow.com/): failed to open stream: No such file or directory' in /in/PqvoK:3 Stack trace: #0 /in/PqvoK(3): SplFileObject->__construct() #1 {main}
Process exited with code 255.
Output for 5.3.29, 5.4.26 - 5.4.40, 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 5.6.28
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known' in /in/PqvoK:3 Stack trace: #0 /in/PqvoK(3): SplFileObject->__construct('http://www.stac...') #1 {main} thrown in /in/PqvoK on line 3
Process exited with code 255.
Output for 5.1.0 - 5.3.28, 5.4.0 - 5.4.25, 5.4.41 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(): php_network_getaddresses: getaddrinfo failed: System error' in /in/PqvoK:3 Stack trace: #0 /in/PqvoK(3): SplFileObject->__construct('http://www.stac...') #1 {main} thrown in /in/PqvoK on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'SplFileObject' not found in /in/PqvoK on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splfileobject in /in/PqvoK on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splfileobject in /in/PqvoK on line 3