3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL | E_STRICT); $profilings=array(microtime(true)); $filename='./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"); $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); sleep(2); $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.0100.00816.40
7.4.50.0150.00516.57
7.4.40.0070.01416.21
7.4.30.0100.01416.36
7.4.20.0150.00516.53
7.4.10.0220.00316.61
7.4.00.0140.00916.59
7.3.180.0110.00616.38
7.3.170.0120.00716.31
7.3.160.0120.01116.47
7.3.150.0140.00516.46
7.3.140.0130.00616.45
7.3.130.0130.00716.45
7.3.120.0070.01116.44
7.3.110.0050.01416.31
7.3.100.0120.00816.44
7.3.90.0110.00916.47
7.3.80.0070.01116.41
7.3.70.0090.01216.26
7.3.60.0120.00716.34
7.3.50.0110.01116.36
7.3.40.0100.00816.46
7.3.30.0120.00916.28
7.3.20.0100.01016.40
7.3.10.0120.01016.28
7.3.00.0090.00816.33
7.2.310.0130.00616.67
7.2.300.0090.01416.67
7.2.290.0110.00916.56
7.2.280.0130.00816.68
7.2.270.0060.01316.61
7.2.260.0110.00816.57
7.2.250.0140.00616.74
7.2.240.0180.00416.71
7.2.230.0180.00716.68
7.2.220.0120.00716.58
7.2.210.0170.00116.63
7.2.200.0140.00816.45
7.2.190.0080.01316.68
7.2.180.0110.01216.55
7.2.170.0120.00916.65
7.2.160.0140.00916.64
7.2.150.0070.01316.66
7.2.140.0130.00716.69
7.2.130.0120.01316.64
7.2.120.0080.01216.71
7.2.110.0100.01516.67
7.2.100.0130.00716.66
7.2.90.0110.00816.61
7.2.80.0140.00916.51
7.2.70.0130.01616.70
7.2.60.0130.00616.66
7.2.50.0130.00816.62
7.2.40.0080.01016.60
7.2.30.0260.00816.55
7.2.20.0100.00916.75
7.2.10.0120.00916.58
7.2.00.0080.01217.35
7.1.330.0050.01415.52
7.1.320.0140.00715.53
7.1.310.0090.01115.60
7.1.300.0140.00915.63
7.1.290.0080.01115.68
7.1.280.0090.00815.64
7.1.270.0060.01215.73
7.1.260.0100.00815.62
7.1.250.0140.01015.43
7.1.240.0080.01015.47
7.1.230.0420.01115.51
7.1.220.0140.00715.54
7.1.210.0080.01315.53
7.1.200.0160.00715.50
7.1.190.0150.01415.47
7.1.180.0140.01315.45
7.1.170.0110.00815.46
7.1.160.0080.01215.55
7.1.150.0090.00715.56
7.1.140.0060.01315.55
7.1.130.0120.00915.35
7.1.120.0130.01015.46
7.1.110.0130.00915.54
7.1.100.0140.00915.60
7.1.90.0090.01115.60
7.1.80.0100.01115.39
7.1.70.0050.00916.17
7.1.60.0100.01116.79
7.1.50.0210.01115.99
7.1.40.0140.00815.47
7.1.30.0140.01115.66
7.1.20.0170.01115.60
7.1.10.0030.01515.57
7.1.00.0080.03217.90
7.0.330.0140.00615.21
7.0.320.0100.01015.10
7.0.310.0090.00915.10
7.0.300.0080.01215.25
7.0.290.0060.01315.19
7.0.280.0070.01015.14
7.0.270.0250.00615.16
7.0.260.0120.00815.30
7.0.250.0140.00915.39
7.0.240.0120.00715.23
7.0.230.0080.01015.15
7.0.220.0120.00715.36
7.0.210.0090.00815.30
7.0.200.0060.00715.68
7.0.190.0120.00815.23
7.0.180.0110.00915.36
7.0.170.0120.00715.28
7.0.160.0120.00915.21
7.0.150.0130.00915.24
7.0.140.0100.03017.44
7.0.130.0120.00715.23
7.0.120.0060.01315.30
7.0.110.0120.00915.07
7.0.100.0050.01615.28
7.0.90.0110.00615.21
7.0.80.0150.00515.13
7.0.70.0080.00915.00
7.0.60.0100.02416.78
7.0.50.0100.01516.06
7.0.40.0160.03616.79
7.0.30.0240.02516.85
7.0.20.0140.02716.72
7.0.10.0080.02116.89
7.0.00.0140.02916.80
5.6.400.0110.01515.95
5.6.390.0110.01315.95
5.6.380.0080.01515.91
5.6.370.0090.01716.07
5.6.360.0070.01415.97
5.6.350.0150.00816.17
5.6.340.0070.01215.92
5.6.330.0040.00816.07
5.6.320.0090.01215.86
5.6.310.0060.01616.02
5.6.300.0160.01015.79
5.6.290.0100.01015.72
5.6.280.0110.02917.66
5.6.270.0050.01615.88
5.6.260.0100.01416.13
5.6.250.0090.01515.86
5.6.240.0100.01115.98
5.6.230.0100.01215.84
5.6.220.0090.01215.87
5.6.210.0100.03417.49
5.6.200.0050.03916.68
5.6.190.0050.04017.52
5.6.180.0150.02617.35
5.6.170.0200.02017.36
5.6.160.0100.02517.34
5.6.150.0090.03516.67
5.6.140.0100.03116.79
5.6.130.0140.02216.68
5.6.120.0110.03317.54
5.6.110.0120.03517.53
5.6.100.0100.02017.63
5.6.90.0060.02317.71
5.6.80.0100.03217.29
5.6.70.0090.01315.95
5.6.60.0090.01216.00
5.6.50.0070.01315.72
5.6.40.0160.00715.94
5.6.30.0050.01415.74
5.6.20.0080.01215.79
5.6.10.0090.02115.91
5.6.00.0110.00915.93
5.5.380.0130.00915.99
5.5.370.0130.00816.05
5.5.360.0060.01416.00
5.5.350.0100.03617.49
5.5.340.0070.02616.64
5.5.330.0120.02717.37
5.5.320.0270.02217.29
5.5.310.0120.03817.40
5.5.300.0120.03216.59
5.5.290.0090.03216.51
5.5.280.0120.02017.58
5.5.270.0100.03517.56
5.5.260.0100.02917.54
5.5.250.0090.02717.56
5.5.240.0110.03017.34
5.5.230.0120.01115.80
5.5.220.0110.01115.90
5.5.210.0080.01215.57
5.5.200.0130.01015.86
5.5.190.0040.01615.84
5.5.180.0040.01415.84
5.5.170.0150.00715.90
5.5.160.0120.00815.86
5.5.150.0070.01315.87
5.5.140.0120.00915.78
5.5.130.0090.01315.88
5.5.120.0130.00715.74
5.5.110.0080.01415.76
5.5.100.0110.00916.08
5.5.90.0100.01015.85
5.5.80.0060.01316.00
5.5.70.0100.01015.78
5.5.60.0090.01015.93
5.5.50.0150.00715.75
5.5.40.0110.01215.85
5.5.30.0140.00815.85
5.5.20.0100.01215.78
5.5.10.0060.01715.84
5.5.00.0060.01615.78
5.4.450.0350.01914.86
5.4.440.0070.02714.93
5.4.430.0140.02415.05
5.4.420.0110.02214.88
5.4.410.0360.02014.94
5.4.400.0440.02114.60
5.4.390.0280.02414.83
5.4.380.0120.02114.71
5.4.370.0170.02514.62
5.4.360.0170.03114.65
5.4.350.0190.02114.61
5.4.340.0160.02314.54
5.4.330.0080.00812.54
5.4.320.0080.02012.51
5.4.310.0080.01812.61
5.4.300.0070.01912.63
5.4.290.0100.01912.54
5.4.280.0080.01912.54
5.4.270.0070.01912.49
5.4.260.0050.02512.54
5.4.250.0070.01912.54
5.4.240.0080.01712.45
5.4.230.0120.01912.52
5.4.220.0080.01912.58
5.4.210.0100.01512.48
5.4.200.0100.02012.58
5.4.190.0090.01912.63
5.4.180.0090.01712.51
5.4.170.0080.01812.50
5.4.160.0070.01712.48
5.4.150.0100.02012.44
5.4.140.0070.02212.35
5.4.130.0080.01812.43
5.4.120.0070.01812.38
5.4.110.0070.01812.45
5.4.100.0100.01912.52
5.4.90.0070.02112.41
5.4.80.0090.02012.48
5.4.70.0070.01712.48
5.4.60.0070.02112.39
5.4.50.0070.02112.40
5.4.40.0070.02312.45
5.4.30.0090.02012.38
5.4.20.0080.02012.52
5.4.10.0070.02012.35
5.4.00.0100.01712.25
5.3.290.0060.02213.09
5.3.280.0080.02012.90
5.3.270.0060.02313.00
5.3.260.0080.01813.05
5.3.250.0090.02013.09
5.3.240.0100.02012.94
5.3.230.0100.02112.93
5.3.220.0090.02212.87
5.3.210.0090.02212.89
5.3.200.0060.02212.91
5.3.190.0060.02113.02
5.3.180.0050.02213.06
5.3.170.0090.02212.97
5.3.160.0060.02113.03
5.3.150.0090.01813.07
5.3.140.0090.01813.04
5.3.130.0080.02413.04
5.3.120.0110.02312.99
5.3.110.0060.02413.00
5.3.100.0090.01812.89
5.3.90.0070.01812.79
5.3.80.0120.01712.64
5.3.70.0090.01712.70
5.3.60.0080.02212.71
5.3.50.0040.02512.75
5.3.40.0090.01812.73
5.3.30.0110.02012.69
5.3.20.0090.01812.55
5.3.10.0080.02912.51
5.3.00.0050.02312.41
5.2.170.0090.01211.08
5.2.160.0070.01511.06
5.2.150.0060.01711.18
5.2.140.0070.01911.19
5.2.130.0090.01511.06
5.2.120.0090.01611.14
5.2.110.0090.01611.06
5.2.100.0040.01911.09
5.2.90.0110.01411.00
5.2.80.0090.01811.01
5.2.70.0070.01810.97
5.2.60.0080.01611.04
5.2.50.0070.01710.92
5.2.40.0090.01310.99
5.2.30.0080.01510.93
5.2.20.0060.01710.85
5.2.10.0080.01710.90
5.2.00.0080.01610.75
5.1.60.0040.0159.97
5.1.50.0080.0119.99
5.1.40.0070.01310.18
5.1.30.0110.01510.33
5.1.20.0070.01610.30
5.1.10.0070.01710.23
5.1.00.0080.01110.02
5.0.50.0080.0119.03
5.0.40.0080.0128.98
5.0.30.0030.0158.92
5.0.20.0040.0148.91
5.0.10.0030.0148.90
5.0.00.0070.0138.90
4.4.90.0040.0098.40
4.4.80.0040.0108.39
4.4.70.0050.0078.39
4.4.60.0050.0098.39
4.4.50.0040.0118.39
4.4.40.0020.0148.37
4.4.30.0020.0118.39
4.4.20.0060.0068.42
4.4.10.0040.0108.42
4.4.00.0040.0128.39
4.3.110.0040.0098.36
4.3.100.0020.0108.36
4.3.90.0050.0058.35
4.3.80.0030.0138.34
4.3.70.0050.0108.34
4.3.60.0050.0068.34
4.3.50.0050.0098.34
4.3.40.0020.0118.32
4.3.30.0050.0067.92
4.3.20.0050.0107.92
4.3.10.0060.0087.90
4.3.00.0040.00612.26

preferences:
37.08 ms | 401 KiB | 5 Q