3v4l.org

run code in 300+ PHP versions simultaneously
<?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 7.1.26 - 7.1.33, 7.2.17 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
Warning: file_exists(): open_basedir restriction in effect. File(picture.jpg) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Qm9IU on line 9 Warning: copy(): open_basedir restriction in effect. File(http://77.172.6.176:50015/picture.jpg) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Qm9IU on line 12 Warning: filemtime(): open_basedir restriction in effect. File(picture.jpg) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Qm9IU on line 13 Warning: copy(): open_basedir restriction in effect. File(http://77.172.6.176:50015/picture.jpg) is not within the allowed path(s): (/tmp:/in:/etc) 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 7.1.20, 7.2.6
Warning: file_exists(): open_basedir restriction in effect. File(picture.jpg) is not within the allowed path(s): (/tmp:/in) in /in/Qm9IU on line 9 Warning: copy(): open_basedir restriction in effect. File(http://77.172.6.176:50015/picture.jpg) is not within the allowed path(s): (/tmp:/in) in /in/Qm9IU on line 12 Warning: filemtime(): open_basedir restriction in effect. File(picture.jpg) is not within the allowed path(s): (/tmp:/in) in /in/Qm9IU on line 13 Warning: copy(): open_basedir restriction in effect. File(http://77.172.6.176:50015/picture.jpg) is not within the allowed path(s): (/tmp:/in) 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 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
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 4.3.3 - 4.3.11, 4.4.0 - 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>

preferences:
149.03 ms | 403 KiB | 243 Q