3v4l.org

run code in 300+ PHP versions simultaneously
<?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } function storefile() { $filename = "10mb.test"; //$time_start = microtime_float(); $filecontent = file_get_contents("http://cachefly.cachefly.net/10mb.test"); //$time_end = microtime_float(); //$time = $time_end - $time_start; //$speed = 10 / $time; //echo "File Downloaded with" . $speed . " Mb/s of speed."; apc_store($filename,$filecontent); } function fetchfile() { $filename = "10mb.test"; $file = apc_fetch($filename); $quoted = sprintf('"%s"', addcslashes(basename($filename), '"\\')); $size = filesize($file); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $quoted); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size); echo $file; } storefile(); fetchfile();
Output for 8.1.0 - 8.1.16, 8.2.0 - 8.2.3, 8.3.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for cachefly.cachefly.net failed: System error in /in/uJDuq on line 13 Warning: file_get_contents(http://cachefly.cachefly.net/10mb.test): Failed to open stream: php_network_getaddresses: getaddrinfo for cachefly.cachefly.net failed: System error in /in/uJDuq on line 13 Fatal error: Uncaught Error: Call to undefined function apc_store() in /in/uJDuq:18 Stack trace: #0 /in/uJDuq(40): storefile() #1 {main} thrown in /in/uJDuq on line 18
Process exited with code 255.
Output for 8.0.0 - 8.0.28
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/uJDuq on line 13 Warning: file_get_contents(http://cachefly.cachefly.net/10mb.test): Failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/uJDuq on line 13 Fatal error: Uncaught Error: Call to undefined function apc_store() in /in/uJDuq:18 Stack trace: #0 /in/uJDuq(40): storefile() #1 {main} thrown in /in/uJDuq on line 18
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/uJDuq on line 13 Warning: file_get_contents(http://cachefly.cachefly.net/10mb.test): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/uJDuq on line 13 Fatal error: Uncaught Error: Call to undefined function apc_store() in /in/uJDuq:18 Stack trace: #0 /in/uJDuq(40): storefile() #1 {main} thrown in /in/uJDuq on line 18
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/uJDuq on line 13 Warning: file_get_contents(http://cachefly.cachefly.net/10mb.test): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/uJDuq on line 13 Fatal error: Call to undefined function apc_store() in /in/uJDuq on line 18
Process exited with code 255.

preferences:
243.94 ms | 402 KiB | 350 Q