3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected static $masks = array( 'default' => "somemask\n", 'other' => "different mask\n" ); public function method($maskName = 'default') { if (array_key_exists($maskName, self::$masks)) { print self::$masks[$maskName]; } else { print "not found\n"; } } } $a = new A(); $a->method('other'); $a->method(); $a->method('undefined');

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.43
8.3.50.0150.00722.16
8.3.40.0110.00318.77
8.3.30.0100.00719.13
8.3.20.0080.00020.05
8.3.10.0080.00021.92
8.3.00.0070.00022.39
8.2.180.0070.01018.16
8.2.170.0170.00022.96
8.2.160.0060.00922.13
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0040.00419.48
8.2.110.0060.00321.93
8.2.100.0120.00019.64
8.2.90.0000.00819.36
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0060.00318.05
8.2.50.0050.00318.07
8.2.40.0050.00318.34
8.2.30.0130.00018.13
8.2.20.0050.00517.77
8.2.10.0040.00419.42
8.2.00.0070.00017.56
8.1.280.0000.01425.92
8.1.270.0080.00022.14
8.1.260.0100.00326.35
8.1.250.0080.00028.09
8.1.240.0030.00623.95
8.1.230.0070.00319.29
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0060.00317.13
8.1.190.0030.00517.52
8.1.180.0080.00018.10
8.1.170.0040.00418.25
8.1.160.0000.00721.95
8.1.150.0040.00418.49
8.1.140.0000.00717.30
8.1.130.0070.00017.70
8.1.120.0040.00317.28
8.1.110.0040.00417.27
8.1.100.0000.00717.42
8.1.90.0040.00417.28
8.1.80.0070.00017.45
8.1.70.0030.00517.28
8.1.60.0050.00317.62
8.1.50.0040.00417.54
8.1.40.0030.00617.53
8.1.30.0040.00417.58
8.1.20.0030.00517.56
8.1.10.0040.00417.48
8.1.00.0000.00717.55
8.0.300.0070.00018.77
8.0.290.0080.00017.04
8.0.280.0030.00318.48
8.0.270.0040.00417.18
8.0.260.0050.00316.81
8.0.250.0070.00016.86
8.0.240.0040.00316.92
8.0.230.0000.00716.80
8.0.220.0030.00316.85
8.0.210.0000.00716.76
8.0.200.0000.00916.89
8.0.190.0030.00516.82
8.0.180.0000.00716.76
8.0.170.0040.00416.86
8.0.160.0040.00416.77
8.0.150.0000.00716.82
8.0.140.0020.00516.72
8.0.130.0040.00413.30
8.0.120.0000.00716.68
8.0.110.0030.00616.76
8.0.100.0000.00716.79
8.0.90.0000.00716.82
8.0.80.0070.01616.75
8.0.70.0050.00216.89
8.0.60.0080.00016.71
8.0.50.0050.00216.82
8.0.30.0100.00817.07
8.0.20.0160.00317.40
8.0.10.0040.00416.89
8.0.00.0090.01116.56
7.4.330.0000.00715.00
7.4.320.0000.00616.53
7.4.300.0030.00316.58
7.4.290.0000.00716.41
7.4.280.0000.00716.40
7.4.270.0000.00716.61
7.4.260.0000.00716.38
7.4.250.0040.00416.57
7.4.240.0020.00516.53
7.4.230.0030.00316.49
7.4.220.0120.00616.62
7.4.210.0090.00516.63
7.4.200.0000.00716.38
7.4.190.0000.00716.46
7.4.160.0080.00816.38
7.4.150.0100.00717.40
7.4.140.0100.00817.86
7.4.130.0140.00516.43
7.4.120.0170.00616.52
7.4.110.0060.01516.48
7.4.100.0080.00816.54
7.4.90.0130.00416.41
7.4.80.0140.00719.39
7.4.70.0060.01016.36
7.4.60.0060.01016.32
7.4.50.0060.00316.44
7.4.40.0090.00622.77
7.4.30.0110.00616.70
7.4.00.0110.00815.09
7.3.330.0030.00313.22
7.3.320.0030.00313.28
7.3.310.0000.00616.13
7.3.300.0000.00716.37
7.3.290.0040.01516.29
7.3.280.0090.00916.30
7.3.270.0070.01017.40
7.3.260.0100.01016.45
7.3.250.0070.01016.49
7.3.240.0140.00316.25
7.3.230.0030.01216.55
7.3.210.0110.01116.39
7.3.200.0130.00319.39
7.3.190.0090.00916.29
7.3.180.0130.00616.31
7.3.170.0060.01516.39
7.3.160.0060.01316.33
7.3.120.0090.00614.68
7.3.110.0110.00714.69
7.3.100.0060.00814.78
7.3.90.0000.00914.87
7.3.80.0080.00814.74
7.3.70.0060.00714.83
7.3.60.0070.00314.95
7.3.50.0060.00614.98
7.3.40.0100.00314.54
7.3.30.0040.01114.89
7.3.20.0120.00016.77
7.3.10.0060.00616.37
7.3.00.0060.00616.67
7.2.330.0110.00616.71
7.2.320.0100.01416.69
7.2.310.0120.00416.60
7.2.300.0060.01716.82
7.2.290.0080.00816.36
7.2.250.0070.01014.91
7.2.240.0000.01714.85
7.2.230.0060.00914.93
7.2.220.0000.01215.02
7.2.210.0080.00814.62
7.2.200.0080.00214.82
7.2.190.0110.00415.15
7.2.180.0040.00814.96
7.2.170.0000.01115.21
7.2.60.0130.00316.75
7.2.50.0030.01016.84
7.2.00.0100.00319.30
7.1.330.0090.00315.79
7.1.320.0060.00616.01
7.1.310.0030.00915.63
7.1.300.0030.00915.76
7.1.290.0000.00815.51
7.1.280.0030.01015.46
7.1.270.0110.00415.89
7.1.260.0030.00615.81
7.1.200.0030.00715.95
7.1.70.0040.00416.77
7.1.60.0070.00317.37
7.1.50.0100.01617.14
7.1.00.0130.08022.50
7.0.200.0030.01016.75
7.0.140.0030.07021.95
7.0.60.0130.07020.01
7.0.50.0030.07717.82
7.0.40.0100.05020.11
7.0.30.0230.04720.30
7.0.20.0400.07020.12
7.0.10.0030.06320.25
7.0.00.0000.04720.08
5.6.280.0100.06721.10
5.6.210.0100.05320.65
5.6.200.0000.04318.25
5.6.190.0170.04320.50
5.6.180.0230.07020.48
5.6.170.0370.04320.62
5.6.160.0100.08020.50
5.6.150.0200.06318.12
5.6.140.0030.05018.18
5.6.130.0030.04318.14
5.6.120.0130.07721.00
5.6.110.0130.06321.04
5.6.100.0100.08321.13
5.6.90.0070.08021.13
5.6.80.0030.08320.38
5.5.350.0000.07320.38
5.5.340.0100.08017.97
5.5.330.0070.08320.36
5.5.320.0200.05320.27
5.5.310.0370.07020.24
5.5.300.0030.04318.03
5.5.290.0070.07317.99
5.5.280.0100.05320.80
5.5.270.0100.08020.72
5.5.260.0130.05320.87
5.5.250.0100.08020.62
5.5.240.0230.08020.07
5.4.450.0530.05019.70
5.4.440.1030.05019.27
5.4.430.0730.07019.32
5.4.420.0930.05719.47
5.4.410.0700.06319.37
5.4.400.0700.05719.25
5.4.390.0730.05719.15
5.4.380.0300.06318.80
5.4.370.0200.04718.69
5.4.360.0200.05018.50
5.4.350.0170.05318.58
5.4.340.0130.05318.52
5.4.320.0080.03512.50
5.4.310.0070.04512.50
5.4.300.0050.04112.50
5.4.290.0050.03812.50
5.4.280.0060.03612.39
5.4.270.0230.07318.84
5.4.260.0130.04718.99
5.4.250.0130.07718.96
5.4.240.0130.06018.64
5.4.230.0170.07018.93
5.4.220.0230.05318.80
5.4.210.0030.06318.96
5.4.200.0170.05318.65
5.4.190.0170.05018.93
5.4.180.0070.06018.93
5.4.170.0100.07318.99
5.4.160.0130.07318.95
5.4.150.0200.06018.75
5.4.140.0130.06716.55
5.4.130.0170.07016.58
5.4.120.0030.05716.39
5.4.110.0070.06016.47
5.4.100.0130.06716.52
5.4.90.0130.06016.41
5.4.80.0030.08316.48
5.4.70.0100.06016.37
5.4.60.0170.05016.59
5.4.50.0130.05016.59
5.4.40.0070.06016.49
5.4.30.0130.05016.38
5.4.20.0130.04716.49
5.4.10.0130.06716.36
5.4.00.0070.05715.84
5.3.290.0050.04012.80
5.3.280.0070.05714.58
5.3.270.0200.05314.77
5.3.260.0100.07014.63
5.3.250.0130.07314.69
5.3.240.0030.06714.68
5.3.230.0100.05314.50
5.3.220.0230.05714.67
5.3.210.0100.07014.47
5.3.200.0170.05014.47
5.3.190.0070.05714.65
5.3.180.0130.06314.74
5.3.170.0100.07014.65
5.3.160.0100.05314.55
5.3.150.0070.05314.70
5.3.140.0070.06014.66
5.3.130.0030.06314.62
5.3.120.0170.06714.77
5.3.110.0000.06714.63
5.3.100.0070.05313.86
5.3.90.0070.07714.11
5.3.80.0130.04713.92
5.3.70.0070.05013.85
5.3.60.0030.07013.91
5.3.50.0070.05714.03
5.3.40.0070.06714.05
5.3.30.0030.05014.07
5.3.20.0100.05313.78
5.3.10.0170.06013.66
5.3.00.0100.06013.63
5.2.170.0030.04711.32
5.2.160.0100.05711.13
5.2.150.0130.03311.13
5.2.140.0070.05311.14
5.2.130.0130.05010.93
5.2.120.0130.04311.18
5.2.110.0070.04311.19
5.2.100.0200.03311.26
5.2.90.0130.03311.18
5.2.80.0100.04011.18
5.2.70.0030.05311.07
5.2.60.0100.05710.95
5.2.50.0100.04711.18
5.2.40.0070.05011.18
5.2.30.0100.03711.06
5.2.20.0100.04710.94
5.2.10.0030.06010.86
5.2.00.0000.06010.72
5.1.60.0100.0479.98
5.1.50.0100.03310.09
5.1.40.0030.0439.96
5.1.30.0100.04310.55
5.1.20.0070.04710.43
5.1.10.0000.05710.09
5.1.00.0000.04310.30
5.0.50.0000.0338.64
5.0.40.0170.0238.61
5.0.30.0070.0408.18
5.0.20.0030.0308.16
5.0.10.0000.0308.12
5.0.00.0130.0508.36
4.4.90.0000.0336.83
4.4.80.0100.0236.83
4.4.70.0030.0236.83
4.4.60.0070.0206.83
4.4.50.0070.0236.83
4.4.40.0030.0476.83
4.4.30.0070.0236.83
4.4.20.0130.0276.83
4.4.10.0070.0236.83
4.4.00.0030.0376.83
4.3.110.0000.0276.83
4.3.100.0130.0206.83
4.3.90.0070.0276.83
4.3.80.0070.0406.83
4.3.70.0000.0276.83
4.3.60.0030.0276.83
4.3.50.0000.0336.83
4.3.40.0100.0476.83
4.3.30.0030.0306.83
4.3.20.0030.0276.83
4.3.10.0000.0336.83
4.3.00.0100.0208.13

preferences:
44.49 ms | 401 KiB | 5 Q