3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL | E_STRICT); $profilings=array(microtime(true)); $filename='/dev/shm/mutex_kv-lock2.lock'; $fo =fopen($filename, 'w+'); $result=flock($fo, LOCK_EX | LOCK_NB, $ref); $r1 =flock($fo, LOCK_UN); $r2 =fclose($fo); var_dump($fo,$result,$r1,$r2,$ref);echo "\r\n"; $fo =fopen($filename, 'w+'); $r0 =flock($fo, LOCK_EX, $ref); $r4 =fwrite($fo, (float)$_SERVER['REQUEST_TIME_FLOAT']."\n"); sleep(2); $r1 =flock($fo, LOCK_UN); $r2 =fclose($fo); var_dump($fo,$r0,$r4,$r1,$r2,$ref);echo "\r\n\r\n"; unset($fo, $r1, $r2, $r0); $profilings[]=microtime(true); echo ($profilings[1]-$profilings[0])."\r\n".(float)$_SERVER['REQUEST_TIME_FLOAT']."\r\n".$profilings[0]."\r\n"; echo 'pid='.posix_getpid(); ?>

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.4.60.0070.01016.27
7.4.50.0090.00816.58
7.4.40.0060.01416.21
7.4.30.0090.00816.31
7.4.20.0130.00716.60
7.4.10.0070.01316.54
7.4.00.0100.00815.73
7.3.180.0070.01016.38
7.3.170.0070.01416.31
7.3.160.0090.00816.35
7.3.150.0130.00516.35
7.3.140.0130.00816.43
7.3.130.0120.01116.44
7.3.120.0080.01115.52
7.3.110.0090.00815.61
7.3.100.0070.01015.62
7.3.90.0100.00815.67
7.3.80.0070.01015.67
7.3.70.0100.00915.59
7.3.60.0120.00815.61
7.3.50.0110.00915.54
7.3.40.0100.01015.60
7.3.30.0100.01015.60
7.3.20.0100.01016.55
7.3.10.0070.01416.58
7.3.00.0100.01016.41
7.2.310.0130.00516.67
7.2.300.0110.00816.53
7.2.290.0080.01216.63
7.2.280.0150.00516.65
7.2.270.0130.00716.58
7.2.260.0140.00616.75
7.2.250.0100.01215.96
7.2.240.0100.01115.84
7.2.230.0100.00915.95
7.2.220.0090.01015.89
7.2.210.0040.01415.86
7.2.200.0110.00915.85
7.2.190.0100.01015.88
7.2.180.0060.01315.86
7.2.170.0060.01415.89
7.2.160.0090.01116.64
7.2.150.0110.01016.56
7.2.140.0120.01016.64
7.2.130.0120.01116.72
7.2.120.0210.01016.69
7.2.110.0160.00616.63
7.2.100.0150.00916.70
7.2.90.0090.01016.63
7.2.80.0090.01316.70
7.2.70.0100.01016.57
7.2.60.0100.01016.62
7.2.50.0140.00816.70
7.2.40.0110.00816.72
7.2.30.0140.00816.70
7.2.20.0130.01416.73
7.2.10.0130.00716.76
7.2.00.0080.01117.48
7.1.330.0080.00915.76
7.1.320.0110.00815.62
7.1.310.0060.01215.78
7.1.300.0100.01115.62
7.1.290.0080.01015.71
7.1.280.0110.00715.66
7.1.270.0100.00815.61
7.1.260.0080.01015.67
7.1.250.0120.00815.43
7.1.240.0080.01115.51
7.1.230.0060.01315.67
7.1.220.0130.00915.54
7.1.210.0140.00415.47
7.1.200.0090.01015.50
7.1.190.0120.00715.41
7.1.180.0120.00715.49
7.1.170.0100.00715.55
7.1.160.0060.01015.47
7.1.150.0100.01015.67
7.1.140.0060.01215.67
7.1.130.0050.01215.61
7.1.120.0170.00915.52
7.1.110.0090.00915.58
7.1.100.0060.01415.61
7.1.90.0130.00515.63
7.1.80.0070.01515.61
7.1.70.0100.00716.17
7.1.60.0110.01216.83
7.1.50.0050.01415.97
7.1.40.0130.00815.63
7.1.30.0150.00515.55
7.1.20.0090.00915.52
7.1.10.0040.01715.58
7.1.00.0100.03417.79
7.0.330.0180.00515.18
7.0.320.0070.01215.27
7.0.310.0070.01215.23
7.0.300.0100.00715.29
7.0.290.0030.01215.27
7.0.280.0130.00815.18
7.0.270.0080.00915.09
7.0.260.0130.00615.33
7.0.250.0120.00615.44
7.0.240.0090.01015.27
7.0.230.0110.00915.15
7.0.220.0090.01015.32
7.0.210.0090.00715.29
7.0.200.0070.00915.56
7.0.190.0100.00715.29
7.0.180.0090.00815.15
7.0.170.0150.00315.21
7.0.160.0100.00715.33
7.0.150.0070.01015.15
7.0.140.0120.03117.52
7.0.130.0120.00415.19
7.0.120.0120.00915.24
7.0.110.0090.00915.18
7.0.100.0070.01115.14
7.0.90.0060.01215.23
7.0.80.0130.00915.23
7.0.70.0140.01215.12
7.0.60.0140.02116.86
7.0.50.0080.03516.10
7.0.40.0110.03316.82
7.0.30.0150.02616.90
7.0.20.0130.02016.81
7.0.10.0150.03316.77
7.0.00.0130.03116.82
5.6.400.0160.00816.01
5.6.390.0060.01816.06
5.6.380.0070.01416.05
5.6.370.0110.01015.95
5.6.360.0130.00816.11
5.6.350.0150.00716.17
5.6.340.0130.00915.96
5.6.330.0120.01215.83
5.6.320.0090.01015.82
5.6.310.0110.01116.17
5.6.300.0180.00616.15
5.6.290.0120.01215.94
5.6.280.0070.03317.66
5.6.270.0100.01016.05
5.6.260.0120.01016.05
5.6.250.0060.01715.88
5.6.240.0100.00915.83
5.6.230.0110.01115.79
5.6.220.0100.01216.11
5.6.210.0120.03517.49
5.6.200.0090.03416.71
5.6.190.0100.02317.44
5.6.180.0270.02417.49
5.6.170.0170.02117.49
5.6.160.0050.04017.45
5.6.150.0110.03216.66
5.6.140.0110.03316.65
5.6.130.0110.01816.73
5.6.120.0120.02117.64
5.6.110.0140.02517.67
5.6.100.0090.02017.70
5.6.90.0110.03417.65
5.6.80.0130.01817.49
5.6.70.0140.00615.94
5.6.60.0130.00715.72
5.6.50.0120.00816.10
5.6.40.0030.01715.88
5.6.30.0030.01715.86
5.6.20.0100.01315.89
5.6.10.0070.01415.61
5.6.00.0130.01315.84
5.5.380.0190.00315.91
5.5.370.0050.01616.20
5.5.360.0100.01215.89
5.5.350.0120.03417.41
5.5.340.0090.03016.62
5.5.330.0100.03317.46
5.5.320.0090.02317.38
5.5.310.0160.03417.41
5.5.300.0100.03616.60
5.5.290.0080.03516.54
5.5.280.0120.03017.67
5.5.270.0090.02317.47
5.5.260.0080.03117.53
5.5.250.0080.02217.42
5.5.240.0130.02817.18
5.5.230.0070.01315.94
5.5.220.0140.00915.95
5.5.210.0080.01215.92
5.5.200.0100.01115.85
5.5.190.0070.01315.96
5.5.180.0120.00815.81
5.5.170.0130.01015.88
5.5.160.0130.01315.79
5.5.150.0130.00815.85
5.5.140.0110.01415.59
5.5.130.0150.00415.62
5.5.120.0200.00315.81
5.5.110.0040.01515.71
5.5.100.0060.01515.65
5.5.90.0160.01015.86
5.5.80.0130.00815.67
5.5.70.0050.01315.86
5.5.60.0040.01515.87
5.5.50.0050.01315.66
5.5.40.0100.01015.74
5.5.30.0020.01615.82
5.5.20.0080.01415.80
5.5.10.0140.00616.01
5.5.00.0050.01516.04
5.4.450.0390.01814.92
5.4.440.0290.02514.86
5.4.430.0320.02214.79
5.4.420.0320.02514.92
5.4.410.0440.02614.76
5.4.400.0300.02414.79
5.4.390.0380.02114.85
5.4.380.0210.02414.50
5.4.370.0170.02414.58
5.4.360.0180.02514.53
5.4.350.0290.03815.65
5.4.340.0230.03015.48
5.4.330.0030.01412.75
5.4.320.0090.02212.59
5.4.310.0060.02612.56
5.4.300.0110.02112.46
5.4.290.0050.02412.52
5.4.280.0020.02512.43
5.4.270.0050.02512.44
5.4.260.0080.02212.45
5.4.250.0070.03212.50
5.4.240.0040.02512.39
5.4.230.0050.02512.51
5.4.220.0080.02312.41
5.4.210.0050.02112.45
5.4.200.0050.02312.46
5.4.190.0070.02712.43
5.4.180.0060.02312.47
5.4.170.0070.02412.51
5.4.160.0060.02212.39
5.4.150.0070.02112.46
5.4.140.0060.02212.23
5.4.130.0100.02112.29
5.4.120.0100.02312.34
5.4.110.0020.02512.18
5.4.100.0050.02212.28
5.4.90.0100.02212.38
5.4.80.0090.02012.20
5.4.70.0090.02112.31
5.4.60.0060.02312.30
5.4.50.0070.02112.26
5.4.40.0070.03511.97
5.4.30.0090.03311.96
5.4.20.0080.03311.96
5.4.10.0050.03511.97
5.4.00.0050.03611.46
5.3.290.0050.02613.02
5.3.280.0060.02512.67
5.3.270.0060.02613.01
5.3.260.0060.02412.90
5.3.250.0100.02012.96
5.3.240.0090.02212.83
5.3.230.0070.02712.74
5.3.220.0060.02712.81
5.3.210.0040.02912.92
5.3.200.0060.02612.85
5.3.190.0060.02412.85
5.3.180.0080.02512.98
5.3.170.0060.02612.77
5.3.160.0050.02312.95
5.3.150.0060.02212.80
5.3.140.0050.03912.66
5.3.130.0090.04712.66
5.3.120.0040.04012.66
5.3.110.0100.03512.65
5.3.100.0090.04312.12
5.3.90.0060.04112.08
5.3.80.0060.04612.08
5.3.70.0030.04412.07
5.3.60.0050.03912.07
5.3.50.0100.04312.01
5.3.40.0060.04512.00
5.3.30.0070.03611.96
5.3.20.0040.04011.74
5.3.10.0040.03711.71
5.3.00.0080.03611.70
5.2.170.0050.0319.21
5.2.160.0060.0289.21
5.2.150.0070.0429.20
5.2.140.0100.0529.20
5.2.130.0090.0459.16
5.2.120.0080.0289.16
5.2.110.0070.0409.17
5.2.100.0080.0259.16
5.2.90.0060.0299.16
5.2.80.0080.0409.16
5.2.70.0040.0319.16
5.2.60.0130.0299.12
5.2.50.0080.0369.09
5.2.40.0020.0399.06
5.2.30.0050.0299.03
5.2.20.0030.0319.02
5.2.10.0080.0368.98
5.2.00.0060.0398.84
5.1.60.0030.0268.12
5.1.50.0090.0258.12
5.1.40.0040.0258.11
5.1.30.0070.0338.45
5.1.20.0050.0288.47
5.1.10.0060.0258.19
5.1.00.0090.0318.20
5.0.50.0030.0296.67
5.0.40.0040.0196.54
5.0.30.0010.0346.35
5.0.20.0060.0216.31
5.0.10.0030.0236.30
5.0.00.0010.0326.29
4.4.90.0040.0154.78
4.4.80.0050.0134.75
4.4.70.0050.0164.76
4.4.60.0030.0204.75
4.4.50.0030.0224.77
4.4.40.0050.0244.71
4.4.30.0050.0244.76
4.4.20.0030.0264.85
4.4.10.0020.0234.85
4.4.00.0040.0244.76
4.3.110.0020.0174.67
4.3.100.0050.0184.66
4.3.90.0020.0184.63
4.3.80.0030.0254.60
4.3.70.0060.0224.63
4.3.60.0040.0234.63
4.3.50.0020.0234.63
4.3.40.0040.0264.55
4.3.30.0040.0183.36
4.3.20.0010.0183.34
4.3.10.0050.0253.30
4.3.00.0000.01316.39

preferences:
46.18 ms | 400 KiB | 5 Q