3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = "/tmp/foo.txt"; file_put_contents($path, "123456"); $file = fopen($path, "r"); flock($file, LOCK_SH | LOCK_NB); `php -r "var_dump(file_put_contents('$file', 'baz'));"`; // should fail because locked clearstatcache(FALSE, $path); $fileSize = filesize($path); // should return 6 bytes but returns 0 echo $fileSize . "\n"; $contents = fread($file, $fileSize); flock($file, LOCK_UN); fclose($file); echo $contents;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.00.0140.00820.02
8.4.150.0030.00014.05
8.4.140.0100.01217.89
8.4.130.0130.00817.86
8.4.120.0050.00620.70
8.4.110.0130.00918.70
8.4.100.0080.00417.98
8.4.90.0110.00920.71
8.4.80.0050.00319.00
8.4.70.0080.01019.07
8.4.60.0120.00818.94
8.4.50.0140.00618.70
8.4.40.0160.00319.43
8.4.30.0130.01017.79
8.4.20.0030.01620.71
8.4.10.0000.00919.58
8.3.280.0020.00014.05
8.3.270.0130.00816.48
8.3.260.0120.00816.60
8.3.250.0140.00518.84
8.3.240.0020.00816.85
8.3.230.0030.00516.68
8.3.220.0050.00318.82
8.3.210.0090.01016.75
8.3.200.0060.00316.59
8.3.190.0110.01116.84
8.3.180.0100.01018.99
8.3.170.0040.01419.01
8.3.160.0120.00617.29
8.3.150.0070.01118.68
8.3.140.0060.00320.73
8.3.130.0130.01018.50
8.3.120.0050.00519.25
8.3.110.0030.00720.94
8.3.100.0120.00824.06
8.3.90.0060.00626.77
8.3.80.0100.00317.97
8.3.70.0130.00716.63
8.3.60.0140.00718.38
8.3.50.0110.00317.25
8.3.40.0120.00318.79
8.3.30.0110.00418.66
8.3.20.0040.00421.85
8.3.10.0040.00420.71
8.3.00.0040.00419.38
8.2.290.0110.00816.72
8.2.280.0100.00520.49
8.2.270.0100.00017.21
8.2.260.0130.00616.99
8.2.250.0120.00618.37
8.2.240.0150.00022.27
8.2.230.0030.00622.58
8.2.220.0100.00037.54
8.2.210.0060.00926.77
8.2.200.0030.00618.79
8.2.190.0090.00616.77
8.2.180.0110.00418.27
8.2.170.0090.00622.96
8.2.160.0070.00720.52
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0030.00519.70
8.2.120.0000.00826.35
8.2.110.0110.00021.07
8.2.100.0090.00317.75
8.2.90.0030.00620.57
8.2.80.0030.00617.97
8.2.70.0140.00518.62
8.2.60.0170.00318.62
8.2.50.0120.00618.62
8.2.40.0090.00918.62
8.2.30.0120.00618.62
8.2.20.0160.00018.62
8.2.10.0180.00018.62
8.2.00.0060.00918.62
8.1.330.0120.00816.16
8.1.320.0060.00415.91
8.1.310.0070.00716.73
8.1.300.0030.00618.15
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0000.00820.41
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0120.00022.07
8.1.230.0040.00820.74
8.1.220.0080.00017.76
8.1.210.0000.01119.02
8.1.200.0100.00718.62
8.1.190.0100.00518.62
8.1.180.0000.01618.62
8.1.170.0100.00718.62
8.1.160.0130.00318.62
8.1.150.0170.00018.62
8.1.140.0100.00618.62
8.1.130.0130.00318.62
8.1.120.0120.00418.62
8.1.110.0160.00018.62
8.1.100.0140.00318.62
8.1.90.0130.00318.62
8.1.80.0170.00318.62
8.1.70.0150.00418.62
8.1.60.0120.00618.62
8.1.50.0090.00918.62
8.1.40.0150.00318.62
8.1.30.0100.00818.62
8.1.20.0000.01718.62
8.1.10.0110.00818.62
8.1.00.0110.00818.62
8.0.300.0030.00520.05
8.0.290.0160.00018.62
8.0.280.0060.01218.62
8.0.270.0110.00718.62
8.0.260.0110.00518.62
8.0.250.0070.01018.62
8.0.240.0040.01218.62
8.0.230.0100.00718.62
8.0.220.0100.00718.62
8.0.210.0110.01118.62
8.0.200.0160.00018.62
8.0.190.0110.00618.62
8.0.180.0140.00318.62
8.0.170.0160.00018.62
8.0.160.0080.00818.62
8.0.150.0160.00018.62
8.0.140.0130.00418.62
8.0.130.0130.00318.62
8.0.120.0080.00818.62
8.0.110.0110.00518.62
8.0.100.0100.00718.62
8.0.90.0180.00018.62
8.0.80.0160.00618.62
8.0.70.0180.00018.62
8.0.60.0160.00018.62
8.0.50.0130.00318.62
8.0.30.0160.00018.62
8.0.20.0170.00018.62
8.0.10.0150.00018.62
8.0.00.0100.00718.62
7.4.330.0080.00518.62
7.4.320.0100.00518.62
7.4.300.0100.00718.62
7.4.290.0110.00618.62
7.4.280.0120.00418.62
7.4.270.0120.00418.62
7.4.260.0110.00518.62
7.4.250.0080.00818.62
7.4.240.0110.00418.62
7.4.230.0130.00418.62
7.4.220.0120.00518.62
7.4.210.0080.00818.62
7.4.200.0150.00018.62
7.4.190.0150.00018.62
7.4.180.0050.01018.62
7.4.160.0100.00518.62
7.4.150.0100.00518.62
7.4.140.0090.00618.62
7.4.130.0100.00518.62
7.4.120.0140.00018.62
7.4.110.0090.00618.62
7.4.100.0120.00418.62
7.4.90.0140.00018.62
7.4.80.0110.00418.62
7.4.70.0080.00818.62
7.4.60.0150.00418.62
7.4.50.0110.00418.62
7.4.40.0090.00518.62
7.4.30.0070.00718.62
7.4.20.0110.00418.62
7.4.10.0140.00018.62
7.4.00.0110.00418.62
7.3.330.0150.00018.62
7.3.320.0110.00418.62
7.3.310.0140.00018.62
7.3.300.0130.00318.62
7.3.290.0000.01518.62
7.3.280.0110.00618.62
7.3.270.0090.00618.62
7.3.260.0080.00818.62
7.3.250.0150.00018.62
7.3.240.0080.00818.62
7.3.230.0150.00018.62
7.3.220.0100.00518.62
7.3.210.0130.00318.62
7.3.200.0100.00718.62
7.3.190.0000.01518.62
7.3.180.0150.00018.62
7.3.170.0100.00518.62
7.3.160.0150.00018.62
7.3.150.0100.00518.62
7.3.140.0160.00018.62
7.3.130.0100.00718.62
7.3.120.0110.00418.62
7.3.110.0110.00418.62
7.3.100.0150.00018.62
7.3.90.0110.00518.62
7.3.80.0120.00318.62
7.3.70.0120.00318.62
7.3.60.0110.00618.62
7.3.50.0080.00818.62
7.3.40.0150.00018.62
7.3.30.0070.00718.62
7.3.20.0150.00318.62
7.3.10.0170.00018.62
7.3.00.0170.00018.62
7.2.340.0110.00418.62
7.2.330.0150.00018.62
7.2.320.0070.00818.62
7.2.310.0160.00018.62
7.2.300.0120.00318.62
7.2.290.0100.00518.62
7.2.280.0080.00818.62
7.2.270.0070.00818.62
7.2.260.0100.00518.62
7.2.250.0150.00018.62
7.2.240.0070.00818.62
7.2.230.0150.00418.62
7.2.220.0120.00318.62
7.2.210.0030.01218.62
7.2.200.0160.00018.62
7.2.190.0090.00618.62
7.2.180.0110.00618.62
7.2.170.0120.00418.62
7.2.160.0080.00818.62
7.2.150.0110.00418.62
7.2.140.0080.00818.62
7.2.130.0080.00818.62
7.2.120.0120.00418.62
7.2.110.0150.00018.62
7.2.100.0130.00318.62
7.2.90.0150.00018.62
7.2.80.0120.00318.62
7.2.70.0100.00718.62
7.2.60.0120.00618.62
7.2.50.0180.00018.62
7.2.40.0080.00818.62
7.2.30.0110.00418.62
7.2.20.0120.00518.62
7.2.10.0050.01018.62
7.2.00.0080.00818.62
7.1.330.0070.00718.62
7.1.320.0090.00518.62
7.1.310.0090.00518.62
7.1.300.0110.00418.62
7.1.290.0120.00318.62
7.1.280.0100.00318.62
7.1.270.0060.00918.62
7.1.260.0130.00018.62
7.1.250.0100.00518.62
7.1.240.0150.00018.62
7.1.230.0160.00018.62
7.1.220.0090.00518.62
7.1.210.0100.00718.62
7.1.200.0110.00418.62
7.1.190.0140.00018.62
7.1.180.0150.00018.62
7.1.170.0100.00518.62
7.1.160.0120.00418.62
7.1.150.0100.00518.62
7.1.140.0150.00018.62
7.1.130.0120.00318.62
7.1.120.0140.00318.62
7.1.110.0110.00418.62
7.1.100.0150.00018.62
7.1.90.0070.00718.62
7.1.80.0120.00418.62
7.1.70.0130.00318.62
7.1.60.0100.00618.62
7.1.50.0130.00318.62
7.1.40.0110.00318.62
7.1.30.0080.00818.62
7.1.20.0040.01218.62
7.1.10.0150.00018.62
7.1.00.0160.00318.62

preferences:
99.39 ms | 403 KiB | 5 Q