3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { static $bar = 1; $bar++; echo $bar; unset($bar); $bar = "|"; echo $bar; // this initialization value is hoisted to the top of the function! static $bar = 5; $bar++; echo $bar; echo " "; static $bar = 77; } test1(); var_dump($bar); test1(); test1(); test1();

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.3.60.0140.00718.67
8.3.50.0080.00921.13
8.3.40.0090.00618.73
8.3.30.0140.00020.38
8.3.20.0000.00720.20
8.3.10.0000.00822.14
8.3.00.0070.00022.41
8.2.180.0150.00416.63
8.2.170.0100.01022.96
8.2.160.0030.01020.35
8.2.150.0040.00424.18
8.2.140.0060.00924.66
8.2.130.0110.00426.16
8.2.120.0090.00619.49
8.2.110.0030.00622.07
8.2.100.0040.00819.21
8.2.90.0080.00019.09
8.2.80.0040.00419.17
8.2.70.0090.00017.63
8.2.60.0040.00417.93
8.2.50.0060.00318.07
8.2.40.0030.00618.34
8.2.30.0030.00518.19
8.2.20.0050.00217.70
8.2.10.0050.00317.81
8.2.00.0130.00017.74
8.1.280.0040.01525.92
8.1.270.0090.00024.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0050.00523.97
8.1.230.0110.00019.21
8.1.220.0040.00417.76
8.1.210.0050.00318.77
8.1.200.0060.00317.13
8.1.190.0040.00417.53
8.1.180.0050.00318.89
8.1.170.0040.00418.47
8.1.160.0000.00722.19
8.1.150.0070.00018.64
8.1.140.0070.00017.51
8.1.130.0000.00717.35
8.1.120.0070.00017.49
8.1.110.0000.00717.52
8.1.100.0000.00817.28
8.1.90.0000.00717.41
8.1.80.0030.00517.36
8.1.70.0000.00717.34
8.1.60.0080.00017.49
8.1.50.0000.00717.53
8.1.40.0000.00817.55
8.1.30.0000.00817.63
8.1.20.0040.00417.60
8.1.10.0000.00817.48
8.1.00.0040.00417.33
8.0.300.0000.00818.77
8.0.290.0000.00717.16
8.0.280.0000.00918.37
8.0.270.0000.00717.26
8.0.260.0060.00016.80
8.0.250.0070.00016.94
8.0.240.0080.00016.98
8.0.230.0040.00416.96
8.0.220.0030.00316.93
8.0.210.0030.00316.97
8.0.200.0000.00616.90
8.0.190.0000.01117.06
8.0.180.0000.00817.04
8.0.170.0000.00716.86
8.0.160.0030.00317.00
8.0.150.0030.00316.73
8.0.140.0040.00416.89
8.0.130.0000.00513.43
8.0.120.0040.00416.91
8.0.110.0070.00016.96
8.0.100.0040.00416.98
8.0.90.0050.00216.95
8.0.80.0110.00716.97
8.0.70.0070.00017.01
8.0.60.0000.00716.99
8.0.50.0040.00416.84
8.0.30.0090.01016.96
8.0.20.0090.01417.40
8.0.10.0050.00217.12
8.0.00.0050.01316.82
7.4.330.0000.00515.00
7.4.320.0000.00616.34
7.4.300.0060.00316.61
7.4.290.0030.00316.61
7.4.280.0000.00816.61
7.4.270.0030.00316.53
7.4.260.0000.00716.55
7.4.250.0050.00316.46
7.4.240.0050.00216.62
7.4.230.0030.00316.42
7.4.220.0090.01716.54
7.4.210.0070.00916.55
7.4.200.0040.00416.58
7.4.190.0000.00716.55
7.4.160.0120.00416.48
7.4.150.0150.00317.40
7.4.140.0090.00917.86
7.4.130.0100.01116.38
7.4.120.0050.01116.52
7.4.110.0090.00916.54
7.4.100.0110.00716.41
7.4.90.0150.00316.54
7.4.80.0140.00519.39
7.4.70.0130.00316.44
7.4.60.0080.00816.64
7.4.50.0000.00516.25
7.4.40.0060.00622.77
7.4.30.0050.01016.68
7.4.00.0040.01114.97
7.3.330.0000.00513.32
7.3.320.0000.00513.34
7.3.310.0040.00416.25
7.3.300.0080.00016.36
7.3.290.0100.01016.32
7.3.280.0070.00716.33
7.3.270.0080.01217.40
7.3.260.0180.00316.34
7.3.250.0150.00616.52
7.3.240.0100.00716.50
7.3.230.0120.00916.46
7.3.210.0040.01216.40
7.3.200.0060.00919.39
7.3.190.0190.00316.37
7.3.180.0130.00316.44
7.3.170.0030.01316.52
7.3.160.0130.00316.64
7.3.120.0030.01215.02
7.2.330.0090.01016.68
7.2.320.0110.00616.62
7.2.310.0070.01016.63
7.2.300.0110.00416.35
7.2.290.0180.00316.31
7.2.60.0030.00916.92
7.2.00.0070.00719.31
7.1.200.0090.00315.57
7.1.100.0070.01118.25
7.1.70.0000.00817.19
7.1.60.0100.01419.29
7.1.50.0090.01616.99
7.1.00.0030.07322.57
7.0.200.0520.00714.61
7.0.140.0030.07022.21
7.0.60.0100.08019.93
7.0.50.0000.04317.86
7.0.40.0070.08720.27
7.0.30.0570.06720.09
7.0.20.0170.07020.12
7.0.10.0070.06020.27
7.0.00.0000.09320.22
5.6.280.0070.07021.10
5.6.210.0070.03720.55
5.6.200.0030.04018.29
5.6.190.0000.09020.39
5.6.180.0230.04720.63
5.6.170.0270.07720.44
5.6.160.0170.04020.48
5.6.150.0070.06018.25
5.6.140.0030.07018.23
5.6.130.0030.08318.16
5.6.120.0030.08321.02
5.6.110.0130.08020.99
5.6.100.0000.04320.98
5.6.90.0170.07321.11
5.6.80.0030.08020.39
5.5.350.0030.04020.42
5.5.340.0100.06317.97
5.5.330.0230.07020.31
5.5.320.0470.07720.28
5.5.310.0270.04720.37
5.5.300.0070.05018.04
5.5.290.0070.07718.03
5.5.280.0100.08320.74
5.5.270.0100.04020.96
5.5.260.0070.03720.76
5.5.250.0070.04020.50
5.5.240.0300.07020.22
5.4.450.0730.05319.48
5.4.440.0870.05719.17
5.4.430.0900.05319.68
5.4.420.0770.06319.60
5.4.410.0730.05719.50
5.4.400.0770.06719.28
5.4.390.0670.05019.06
5.4.380.0230.05318.79
5.4.370.0030.04318.62
5.4.360.0100.03318.79
5.4.350.0090.03912.02
5.4.340.0070.04812.02
5.4.320.0060.03612.50
5.4.310.0060.04212.50
5.4.300.0050.03712.50
5.4.290.0070.03612.50
5.4.280.0050.03812.40
5.4.270.0040.04212.39
5.4.260.0100.03212.40
5.4.250.0070.05718.72
5.4.240.0070.07318.85
5.4.230.0200.04018.80
5.4.220.0030.05718.75
5.4.210.0230.03718.72
5.4.200.0070.05018.87
5.4.190.0070.05018.91
5.4.180.0070.05018.85
5.4.170.0100.06018.85
5.4.160.0000.05718.92
5.4.150.0170.04718.64
5.4.140.0100.04716.39
5.4.130.0030.05316.43
5.4.120.0100.04316.58
5.4.110.0100.04716.40
5.4.100.0030.06316.52
5.4.90.0070.05016.40
5.4.80.0100.06016.31
5.4.70.0100.04316.38
5.4.60.0030.05716.38
5.4.50.0070.04716.39
5.4.40.0070.05016.48
5.4.30.0030.05016.28
5.4.20.0030.05016.29
5.4.10.0100.05016.46
5.4.00.0070.07015.99
5.3.290.0040.04112.80
5.3.280.0130.04714.67
5.3.270.0130.04314.68
5.3.260.0000.05714.43
5.3.250.0130.04314.57
5.3.240.0030.06014.68
5.3.230.0070.05014.58
5.3.220.0170.04014.78
5.3.210.0070.05314.73
5.3.200.0000.05314.73
5.3.190.0170.05714.64
5.3.180.0070.07014.54
5.3.170.0100.04314.63
5.3.160.0070.05014.56
5.3.150.0030.05014.71
5.3.140.0030.05014.77
5.3.130.0130.04714.53
5.3.120.0070.05314.37
5.3.110.0130.04714.55
5.3.100.0000.05314.11
5.3.90.0000.05714.03
5.3.80.0030.05314.24
5.3.70.0000.05714.09
5.3.60.0130.04013.96
5.3.50.0100.04713.93
5.3.40.0100.06713.95
5.3.30.0000.05314.07
5.3.20.0100.05013.78
5.3.10.0100.04313.63
5.3.00.0030.05013.63
5.2.170.0070.03711.14
5.2.160.0100.03311.36
5.2.150.0030.04311.23
5.2.140.0070.04011.11
5.2.130.0000.04711.16
5.2.120.0100.03311.07
5.2.110.0000.04311.05
5.2.100.0000.04311.18
5.2.90.0100.03311.05
5.2.80.0030.04311.17
5.2.70.0030.04311.09
5.2.60.0030.04311.00
5.2.50.0030.04010.98
5.2.40.0000.05310.97
5.2.30.0130.05011.03
5.2.20.0070.03710.93
5.2.10.0030.04010.76
5.2.00.0100.03310.55
5.1.60.0030.04710.09
5.1.50.0100.0439.84
5.1.40.0070.03010.13
5.1.30.0030.03710.41
5.1.20.0070.03710.25
5.1.10.0030.03710.22
5.1.00.0000.05310.06
5.0.50.0130.0208.51
5.0.40.0000.0308.48
5.0.30.0000.0438.31
5.0.20.0030.0278.17
5.0.10.0070.0238.23
5.0.00.0000.0578.16
4.4.90.0030.0207.43
4.4.80.0070.0177.43
4.4.70.0000.0237.43
4.4.60.0070.0177.43
4.4.50.0000.0237.43
4.4.40.0030.0337.43
4.4.30.0030.0207.43
4.4.20.0000.0237.43
4.4.10.0170.0307.43
4.4.00.0030.0337.43
4.3.110.0000.0237.43
4.3.100.0000.0207.43
4.3.90.0070.0137.43
4.3.80.0030.0307.43
4.3.70.0030.0207.43
4.3.60.0130.0107.43
4.3.50.0000.0237.43
4.3.40.0000.0337.43
4.3.30.0000.0337.43
4.3.20.0030.0207.43
4.3.10.0000.0207.43
4.3.00.0130.0277.44

preferences:
44.1 ms | 401 KiB | 5 Q