3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateTmpFilename(): string { $filename = sys_get_temp_dir().'/'.bin2hex(random_bytes(16)).'.tmp'; touch($filename); return $filename; } $tmpFilename = generateTmpFilename(); $f = fopen($tmpFilename, 'rwb'); # this is the only difference fwrite($f, 'Woop die loop'); fwrite($f, 'Scoop'); fclose($f); # Note that this is empty output var_dump(file_get_contents($tmpFilename)); $tmpFilename = generateTmpFilename(); $f = fopen($tmpFilename, 'wrb'); # this is the only difference fwrite($f, 'I ate'); fwrite($f, 'Noogie'); fclose($f); # And this one contains expected text var_dump(file_get_contents($tmpFilename));

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)
7.3.40.0090.00614.59
7.3.30.0060.00814.66
7.3.20.0110.00615.63
7.3.10.0140.00615.78
7.3.00.0150.01115.68
7.2.170.0060.00714.96
7.2.160.0090.00814.90
7.2.150.0070.00715.83
7.2.140.0200.00715.87
7.2.130.0050.01315.98
7.2.120.0100.01015.75
7.2.110.0130.01115.96
7.2.100.0120.01015.75
7.2.90.0110.01215.98
7.2.80.0100.00615.72
7.2.70.0150.00915.93
7.2.60.0090.00715.85
7.2.50.0090.00615.87
7.2.40.0070.00916.03
7.2.30.0100.01115.96
7.2.20.0130.01116.00
7.2.10.0130.00316.06
7.2.00.0090.00716.00
7.1.280.0130.00314.85
7.1.270.0140.01014.77
7.1.260.0080.01015.04
7.1.250.0180.00214.90
7.1.240.0200.01413.95
7.1.230.0170.00613.86
7.1.220.0210.01013.64
7.1.210.0140.01113.49
7.1.200.0170.00314.00
7.1.190.0190.01013.95
7.1.180.0200.00013.89
7.1.170.0220.00013.68
7.1.160.0160.00614.00
7.1.150.0180.01914.13
7.1.140.0220.00913.85
7.1.130.0080.01214.09
7.1.120.0080.01213.92
7.1.110.0160.01313.77
7.1.100.0190.01413.96
7.1.90.0210.00514.01
7.1.80.0180.00713.92
7.1.70.0050.01914.11
7.1.60.1780.00913.84
7.1.50.0110.00913.99
7.1.40.0170.00713.79
7.1.30.0110.01513.55
7.1.20.0170.01413.77
7.1.10.0140.00613.71
7.1.00.0160.00813.89
7.0.330.0190.00613.58
7.0.320.0160.00613.03
7.0.310.0970.01313.41
7.0.300.0140.01013.36
7.0.290.0270.00313.33
7.0.280.0180.01113.27
7.0.270.0220.01013.29
7.0.260.0150.00613.62
7.0.250.0160.00713.42
7.0.240.0080.02413.64
7.0.230.0190.01113.46
7.0.220.0080.00813.74
7.0.210.0110.01413.25
7.0.200.0240.00913.23
7.0.190.0130.00513.49
7.0.180.0170.01713.59
7.0.170.0100.01713.28
7.0.160.0130.00913.53
7.0.150.0240.00413.32
7.0.140.0110.01013.54
7.0.130.0210.00313.29
7.0.120.0130.00813.52
7.0.110.0180.00713.55
7.0.100.0180.01113.44
7.0.90.0130.01213.32
7.0.80.0120.01613.38
7.0.70.0150.00613.53
7.0.60.0190.01013.54
7.0.50.0090.00913.57
7.0.40.0130.00513.47
7.0.30.0000.01713.64
7.0.20.0490.01013.44
7.0.10.0270.00713.59
7.0.00.0090.00513.39
5.6.400.0030.01713.74
5.6.390.0120.00713.93
5.6.380.0120.02013.63
5.6.370.0150.01214.34
5.6.360.0160.00514.11
5.6.350.0170.01414.39
5.6.340.0170.01014.11
5.6.330.0090.01513.98
5.6.320.0120.01014.15
5.6.310.0190.00713.90
5.6.300.0100.01413.93
5.6.290.0130.01114.19
5.6.280.0150.01514.08
5.6.270.0190.00714.34
5.6.260.0120.00814.05
5.6.250.0140.01414.03
5.6.240.0120.01514.23
5.6.230.0170.00713.96
5.6.220.0170.01014.11
5.6.210.0100.01013.89
5.6.200.0200.01414.02
5.6.190.0130.00013.83
5.6.180.0120.00913.91
5.6.170.0200.00714.10
5.6.160.0070.01013.61
5.6.150.0130.00313.80
5.6.140.0140.00513.98
5.6.130.0100.01013.98
5.6.120.0110.01114.04
5.6.110.0090.01213.87
5.6.100.0210.00914.07
5.6.90.0160.00513.96
5.6.80.0080.01214.06
5.6.70.0230.00013.89
5.6.60.0170.00714.18
5.6.50.0050.01113.65
5.6.40.0140.00813.90
5.6.30.0160.00313.81
5.6.20.0160.00813.85
5.6.10.0220.00713.94
5.6.00.0140.00713.88
5.5.380.0110.01114.04
5.5.370.0080.02014.04
5.5.360.0050.02313.91
5.5.350.0170.00914.18
5.5.340.0110.01013.73
5.5.330.0110.00313.85
5.5.320.0090.01213.76
5.5.310.0080.00914.00
5.5.300.0140.01514.23
5.5.290.0160.00614.07
5.5.280.0120.00713.96
5.5.270.0230.00814.32
5.5.260.0120.01513.86
5.5.250.0070.01113.99
5.5.240.0070.01413.89
5.5.230.0140.00613.98
5.5.220.0120.00813.63
5.5.210.0200.01213.80
5.5.200.0160.01014.11
5.5.190.0160.00313.95
5.5.180.0110.00614.08
5.5.170.0150.01513.63
5.5.160.0180.01313.75
5.5.150.0110.01114.19
5.5.140.0100.00713.61
5.5.130.0180.00613.63
5.5.120.0170.01113.89
5.5.110.0150.00814.11
5.5.100.0180.00713.71
5.5.90.0220.00314.04
5.5.80.0110.00714.10
5.5.70.0140.00414.22
5.5.60.0290.00914.06
5.5.50.0140.00413.54
5.5.40.0180.00313.84
5.5.30.0110.01114.06
5.5.20.0110.00714.14
5.5.10.0210.00313.94
5.5.00.0070.01014.15
5.4.450.0140.00311.81
5.4.440.0120.00311.81
5.4.430.0160.00311.81
5.4.420.0170.00311.81
5.4.410.0100.01011.81
5.4.400.0110.00511.81
5.4.390.0130.00511.81
5.4.380.0060.00811.81
5.4.370.0130.00311.81
5.4.360.0120.00011.81
5.4.350.0100.00711.81
5.4.340.0070.00711.81
5.4.330.0160.00311.81
5.4.320.0160.00011.81
5.4.310.0110.00311.81
5.4.300.0080.00511.81
5.4.290.0090.00411.81
5.4.280.0110.00311.81
5.4.270.0100.00311.81
5.4.260.0130.00411.81
5.4.250.0160.00011.81
5.4.240.0110.00311.81
5.4.230.0070.00711.81
5.4.220.0110.00911.81
5.4.210.0080.00911.81
5.4.200.0150.00511.81
5.4.190.0090.00511.81
5.4.180.0080.00811.81
5.4.170.0110.00311.81
5.4.160.0130.00311.81
5.4.150.0080.00611.81
5.4.140.0140.00311.81
5.4.130.0070.00711.81
5.4.120.0040.00911.81
5.4.110.0100.00311.81
5.4.100.0100.00511.81
5.4.90.0090.00311.81
5.4.80.0130.00011.81
5.4.70.0060.00711.81
5.4.60.0040.00911.81
5.4.50.0140.00311.81
5.4.40.0030.00911.81
5.4.30.0120.00311.81
5.4.20.0070.00511.81
5.4.10.0000.01311.81
5.4.00.0040.00911.81
5.3.290.0040.00911.81
5.3.280.0140.00511.81
5.3.270.0170.00311.81
5.3.260.0080.00411.81
5.3.250.0110.00411.81
5.3.240.0100.00411.81
5.3.230.0090.00311.81
5.3.220.0040.00911.81
5.3.210.0040.00911.81
5.3.200.0070.00711.81
5.3.190.0060.00611.81
5.3.180.0080.00411.81
5.3.170.0080.00411.81
5.3.160.0040.01011.81
5.3.150.0120.00011.81
5.3.140.0060.00611.81
5.3.130.0090.00611.81
5.3.120.0120.00011.81
5.3.110.0100.00711.81
5.3.100.0090.00311.81
5.3.90.0000.01011.81
5.3.80.0120.00611.81
5.3.70.0130.00911.81
5.3.60.0090.00611.81
5.3.50.0050.00911.81
5.3.40.0100.00711.81
5.3.30.0120.00311.81
5.3.20.0090.00611.81
5.3.10.0150.00011.81
5.3.00.0130.00011.81
5.2.170.0060.00311.81
5.2.160.0100.00011.81
5.2.150.0100.00011.81
5.2.140.0030.00711.81
5.2.130.0050.00511.81
5.2.120.0070.00411.81
5.2.110.0080.00311.81
5.2.100.0040.00711.81
5.2.90.0080.00011.81
5.2.80.0070.00311.81
5.2.70.0050.00511.81
5.2.60.0050.00511.81
5.2.50.0110.00011.81
5.2.40.0070.00411.81
5.2.30.0060.00311.81
5.2.20.0110.00311.81
5.2.10.0050.00511.81
5.2.00.0040.01111.81
5.1.60.0060.00611.81
5.1.50.0030.00711.81
5.1.40.0090.00611.81
5.1.30.0040.00411.81
5.1.20.0050.00511.81
5.1.10.0080.00011.81
5.1.00.0080.00311.81
5.0.50.0020.00511.81
5.0.40.0100.00311.81
5.0.30.0080.00411.81
5.0.20.0060.00011.81
5.0.10.0060.00311.81
5.0.00.0040.00411.81
4.4.90.0000.00611.81
4.4.80.0030.00211.81
4.4.70.0030.00311.81
4.4.60.0070.00311.81
4.4.50.0040.00211.81
4.4.40.0000.00711.81
4.4.30.0060.00211.81
4.4.20.0050.00011.81
4.4.10.0000.00911.81
4.4.00.0030.00311.81
4.3.110.0030.00311.81
4.3.100.0030.00611.81
4.3.90.0030.00411.81
4.3.80.0060.00011.81
4.3.70.0060.00011.81
4.3.60.0040.00811.81
4.3.50.0030.00311.81
4.3.40.0040.00211.81
4.3.30.0050.00011.81
4.3.20.0030.00211.81
4.3.10.0040.00411.81
4.3.00.0040.00411.81

preferences:
42.33 ms | 403 KiB | 5 Q