3v4l.org

run code in 500+ PHP versions simultaneously
<?php // doesn't update realpath cache touch('/tmp/foo'); var_dump(filemtime('/tmp/foo')); touch('/tmp/foo', 1); var_dump(filemtime('/tmp/foo')); // does update the realpath cache touch('file:///tmp/foo'); var_dump(filemtime('file:///tmp/foo')); touch('file:///tmp/foo', 1); var_dump(filemtime('file:///tmp/foo'));
Output for 4.3.0 - 4.3.1
int(1480431692) int(1480431692) Warning: touch() [http://www.php.net/function.touch]: Unable to create file file:///tmp/foo because No such file or directory in /in/0VQIo on line 11 Warning: filemtime() [http://www.php.net/function.filemtime]: Stat failed for file:///tmp/foo (errno=2 - No such file or directory) in /in/0VQIo on line 12 bool(false) Warning: touch() [http://www.php.net/function.touch]: Unable to create file file:///tmp/foo because No such file or directory in /in/0VQIo on line 13 Warning: filemtime() [http://www.php.net/function.filemtime]: Stat failed for file:///tmp/foo (errno=2 - No such file or directory) in /in/0VQIo on line 14 bool(false)
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
int(1480431692) int(1480431692) Warning: touch(): Unable to create file file:///tmp/foo because No such file or directory in /in/0VQIo on line 11 Warning: filemtime(): Stat failed for file:///tmp/foo (errno=2 - No such file or directory) in /in/0VQIo on line 12 bool(false) Warning: touch(): Unable to create file file:///tmp/foo because No such file or directory in /in/0VQIo on line 13 Warning: filemtime(): Stat failed for file:///tmp/foo (errno=2 - No such file or directory) in /in/0VQIo on line 14 bool(false)
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
int(1480431692) int(1480431692) Warning: touch(): Unable to create file file:///tmp/foo because No such file or directory in /in/0VQIo on line 11 int(1480431692) Warning: touch(): Unable to create file file:///tmp/foo because No such file or directory in /in/0VQIo on line 13 int(1480431692)
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 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, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
int(1480431692) int(1480431692) int(1480431692) int(1480431692)
Output for 8.1.34
int(1767291720) int(1767291720) int(1767291720) int(1)
Output for 8.2.30
int(1766951712) int(1766951712) int(1766951712) int(1)
Output for 8.2.31
int(1781522480) int(1781522480) int(1781522480) int(1)
Output for 8.2.32
int(1784019738) int(1784019738) int(1784019738) int(1)
Output for 8.2.34
int(1790611450) int(1790611450) int(1790611450) int(1)
Output for 8.3.28
int(1764114759) int(1) int(1764114759) int(1)
Output for 8.3.29
int(1766633097) int(1) int(1766633097) int(1)
Output for 8.3.30
int(1769049331) int(1) int(1769049331) int(1)
Output for 8.3.31
int(1781048419) int(1) int(1781048419) int(1)
Output for 8.3.32
int(1783647854) int(1) int(1783647854) int(1)
Output for 8.3.33
int(1785905347) int(1) int(1785905347) int(1)
Output for 8.3.35
int(1790606890) int(1) int(1790606890) int(1)
Output for 8.4.15
int(1773666018) int(1) int(1773666018) int(1)
Output for 8.4.16
int(1766360767) int(1) int(1766360767) int(1)
Output for 8.4.17
int(1768774920) int(1) int(1768774920) int(1)
Output for 8.4.18
int(1771267587) int(1) int(1771267587) int(1)
Output for 8.4.21
int(1780301051) int(1) int(1780301051) int(1)
Output for 8.4.22
int(1780775677) int(1) int(1780775677) int(1)
Output for 8.4.23
int(1783392491) int(1) int(1783392491) int(1)
Output for 8.4.24
int(1785649528) int(1) int(1785649528) int(1)
Output for 8.4.25
int(1790581473) int(1) int(1790581473) int(1)
Output for 8.4.26
int(1790572887) int(1) int(1790572887) int(1)
Output for 8.5.0
int(1763678213) int(1) int(1763678213) int(1)
Output for 8.5.1
int(1765949662) int(1) int(1765949662) int(1)
Output for 8.5.2
int(1768367760) int(1) int(1768367760) int(1)
Output for 8.5.3
int(1770786078) int(1) int(1770786078) int(1)
Output for 8.5.5
int(1780061921) int(1) int(1780061921) int(1)
Output for 8.5.6
int(1779889211) int(1) int(1779889211) int(1)
Output for 8.5.7
int(1780521353) int(1) int(1780521353) int(1)
Output for 8.5.8
int(1783153215) int(1) int(1783153215) int(1)
Output for 8.5.9
int(1785496808) int(1) int(1785496808) int(1)
Output for 8.5.10
int(1790560204) int(1) int(1790560204) int(1)
Output for 8.5.11
int(1790548289) int(1) int(1790548289) int(1)

preferences:
52.62 ms | 1281 KiB | 52 Q