3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php #Settings $interval = 30; $filename = 'picture.jpg'; $url = "http://www.goudenspike.nl/webcam/picture.jpg"; $fetchurl = "http://77.172.6.176:50015/picture.jpg"; #get file time if (file_exists($filename)) { $filetime = filemtime($filename); } else { copy($fetchurl,$filename); $filetime = filemtime($filename); } $time = time(); $diff = $time - $filetime; if($diff > $interval){ copy($fetchurl,$filename); } #header("Location: $url"); echo "<meta http-equiv=refresh content=30><IMG SRC=$url WIDTH=576 HEIGHT=432>"; exit; ?>
Output for 5.0.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: copy(http://77.172.6.176:50015/picture.jpg): failed to open stream: Network is unreachable in /in/Qm9IU on line 12 Warning: filemtime(): stat failed for picture.jpg in /in/Qm9IU on line 13 Warning: copy(http://77.172.6.176:50015/picture.jpg): failed to open stream: Network is unreachable in /in/Qm9IU on line 20 <meta http-equiv=refresh content=30><IMG SRC=http://www.goudenspike.nl/webcam/picture.jpg WIDTH=576 HEIGHT=432>
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://77.172.6.176:50015/picture.jpg () in /in/Qm9IU on line 12 Warning: filemtime(): No such file or directory in /in/Qm9IU on line 13 Warning: Failed to open http://77.172.6.176:50015/picture.jpg () in /in/Qm9IU on line 20 <meta http-equiv=refresh content=30><IMG SRC=http://www.goudenspike.nl/webcam/picture.jpg WIDTH=576 HEIGHT=432>
Output for 4.3.3 - 4.4.9
Warning: copy(http://77.172.6.176:50015/picture.jpg): failed to open stream: Network is unreachable in /in/Qm9IU on line 12 Warning: filemtime(): Stat failed for picture.jpg (errno=2 - No such file or directory) in /in/Qm9IU on line 13 Warning: copy(http://77.172.6.176:50015/picture.jpg): failed to open stream: Network is unreachable in /in/Qm9IU on line 20 <meta http-equiv=refresh content=30><IMG SRC=http://www.goudenspike.nl/webcam/picture.jpg WIDTH=576 HEIGHT=432>
Output for 4.3.2
Warning: copy(): php_hostconnect: connect failed in /in/Qm9IU on line 12 Warning: copy(http://77.172.6.176:50015/picture.jpg): failed to open stream: Network is unreachable in /in/Qm9IU on line 12 Warning: filemtime(): Stat failed for picture.jpg (errno=2 - No such file or directory) in /in/Qm9IU on line 13 Warning: copy(): php_hostconnect: connect failed in /in/Qm9IU on line 20 Warning: copy(http://77.172.6.176:50015/picture.jpg): failed to open stream: Network is unreachable in /in/Qm9IU on line 20 <meta http-equiv=refresh content=30><IMG SRC=http://www.goudenspike.nl/webcam/picture.jpg WIDTH=576 HEIGHT=432>
Output for 4.3.0 - 4.3.1
Warning: copy() [http://www.php.net/function.copy]: php_hostconnect: connect failed in /in/Qm9IU on line 12 Warning: copy(http://77.172.6.176:50015/picture.jpg) [http://www.php.net/function.copy]: failed to create stream: Network is unreachable in /in/Qm9IU on line 12 Warning: filemtime() [http://www.php.net/function.filemtime]: Stat failed for picture.jpg (errno=2 - No such file or directory) in /in/Qm9IU on line 13 Warning: copy() [http://www.php.net/function.copy]: php_hostconnect: connect failed in /in/Qm9IU on line 20 Warning: copy(http://77.172.6.176:50015/picture.jpg) [http://www.php.net/function.copy]: failed to create stream: Network is unreachable in /in/Qm9IU on line 20 <meta http-equiv=refresh content=30><IMG SRC=http://www.goudenspike.nl/webcam/picture.jpg WIDTH=576 HEIGHT=432>