3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { } $obj = new myClass; $obj->color = function( $flower ){ $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; return $arr[$flower]; }; $flowers = [0=>"rose",1=>"violet"]; foreach ($flowers as $flower){ echo "{$flower}s are ",($obj->color)($flower),"\n"; }

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.0110.00416.63
8.3.50.0060.00918.05
8.3.40.0070.00718.97
8.3.30.0100.00318.88
8.3.20.0000.00821.99
8.3.10.0050.00321.73
8.3.00.0050.00323.70
8.2.180.0110.00716.75
8.2.170.0110.00422.96
8.2.160.0090.00622.08
8.2.150.0110.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00020.82
8.2.120.0040.00426.35
8.2.110.0030.00719.35
8.2.100.0040.00817.79
8.2.90.0000.00819.21
8.2.80.0050.00317.97
8.2.70.0050.00317.50
8.2.60.0040.00418.01
8.2.50.0040.00418.10
8.2.40.0050.00322.32
8.2.30.0000.00719.52
8.2.20.0070.00017.80
8.2.10.0050.00217.95
8.2.00.0000.00718.18
8.1.280.0090.00625.92
8.1.270.0090.00922.11
8.1.260.0100.00028.09
8.1.250.0080.00028.09
8.1.240.0030.00623.96
8.1.230.0110.00317.79
8.1.220.0040.00417.80
8.1.210.0060.00318.77
8.1.200.0000.00817.35
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0030.00618.51
8.1.160.0040.00420.69
8.1.150.0040.00418.77
8.1.140.0050.00319.54
8.1.130.0080.00017.71
8.1.120.0040.00417.46
8.1.110.0030.00317.50
8.1.100.0040.00417.46
8.1.90.0050.00317.41
8.1.80.0000.00717.52
8.1.70.0000.00717.46
8.1.60.0000.00917.49
8.1.50.0040.00417.43
8.1.40.0000.00817.54
8.1.30.0000.00917.54
8.1.20.0030.00517.70
8.1.10.0080.00017.56
8.1.00.0080.00017.45
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0000.00818.55
8.0.270.0030.00317.26
8.0.260.0070.00017.31
8.0.250.0070.00016.92
8.0.240.0020.00516.87
8.0.230.0000.00717.01
8.0.220.0030.00616.82
8.0.210.0070.00016.86
8.0.200.0030.00616.81
8.0.190.0020.00517.01
8.0.180.0000.00716.84
8.0.170.0030.00616.95
8.0.160.0000.00716.95
8.0.150.0040.00416.76
8.0.140.0030.00516.87
8.0.130.0030.00313.36
8.0.120.0000.00816.78
8.0.110.0030.00616.88
8.0.100.0000.00716.79
8.0.90.0000.00816.94
8.0.80.0090.00616.90
8.0.70.0070.00016.88
8.0.60.0000.00716.76
8.0.50.0020.00516.77
8.0.30.0060.01017.11
8.0.20.0100.00817.40
8.0.10.0040.00416.90
8.0.00.0100.00816.75
7.4.330.0050.00016.79
7.4.320.0030.00316.61
7.4.300.0030.00316.49
7.4.290.0000.00716.48
7.4.280.0070.00316.63
7.4.270.0000.00616.55
7.4.260.0070.00316.59
7.4.250.0070.00016.51
7.4.240.0000.00716.48
7.4.230.0070.00016.41
7.4.220.0100.00716.63
7.4.210.0060.00916.47
7.4.200.0030.00316.42
7.4.160.0000.01416.37
7.4.150.0110.00717.40
7.4.140.0080.01017.86
7.4.130.0120.00716.58
7.4.120.0060.01116.54
7.4.110.0030.01316.49
7.4.100.0130.00316.57
7.4.90.0120.00616.57
7.4.80.0100.00719.39
7.4.70.0090.01016.66
7.4.60.0040.01516.55
7.4.50.0070.00716.43
7.4.40.0100.00716.62
7.4.30.0140.00416.47
7.4.10.0030.01414.86
7.4.00.0110.00614.91
7.3.330.0030.00313.27
7.3.320.0030.00313.27
7.3.310.0070.00016.36
7.3.300.0040.00416.17
7.3.290.0030.00316.30
7.3.280.0090.00716.26
7.3.270.0120.00617.40
7.3.260.0100.00616.60
7.3.250.0150.00516.57
7.3.240.0090.00916.39
7.3.230.0060.01216.39
7.3.210.0110.00616.29
7.3.200.0100.01319.39
7.3.190.0140.00316.52
7.3.180.0150.00016.39
7.3.170.0000.01716.39
7.3.160.0100.00716.41
7.3.130.0030.01714.77
7.3.120.0030.01514.95
7.3.110.0060.01314.98
7.3.100.0030.01014.86
7.3.90.0130.00014.85
7.3.80.0000.01014.83
7.3.70.0080.00314.92
7.3.60.0060.00914.85
7.3.50.0040.01114.91
7.3.40.0090.00615.04
7.3.30.0060.00614.83
7.3.20.0030.01416.46
7.3.10.0060.00616.42
7.3.00.0040.00416.40
7.2.330.0100.00716.74
7.2.320.0060.00916.49
7.2.310.0100.00716.61
7.2.300.0030.01316.58
7.2.290.0070.01116.66
7.2.260.0060.01214.92
7.2.250.0060.01315.05
7.2.240.0090.00615.08
7.2.230.0100.00715.00
7.2.220.0130.00315.07
7.2.210.0110.00315.24
7.2.200.0000.01314.97
7.2.190.0100.00715.22
7.2.180.0120.00415.08
7.2.170.0060.00615.29
7.2.160.0030.01315.07
7.2.150.0030.01416.86
7.2.140.0030.01316.84
7.2.130.0030.00716.95
7.2.120.0040.01116.66
7.2.110.0030.00616.90
7.2.100.0040.00816.75
7.2.90.0000.01516.94
7.2.80.0090.00616.75
7.2.70.0030.01017.01
7.2.60.0020.01216.96
7.2.50.0110.00017.11
7.2.40.0090.00017.03
7.2.30.0090.00917.17
7.2.20.0030.01016.71
7.2.10.0080.00417.01
7.2.00.0030.00818.08
7.1.330.0040.01115.76
7.1.320.0120.00615.56
7.1.310.0070.00815.94
7.1.300.0030.01215.80
7.1.290.0030.00915.99
7.1.280.0060.01215.86
7.1.270.0040.00415.66
7.1.260.0080.00415.86
7.1.250.0070.00716.02
7.1.240.0030.00515.87
7.1.230.0060.00615.93
7.1.220.0060.00315.79
7.1.210.0030.01015.90
7.1.200.0080.00315.93
7.1.190.0080.00815.94
7.1.180.0000.01215.95
7.1.170.0090.00015.85
7.1.160.0070.00415.59
7.1.150.0040.00715.54
7.1.140.0000.01215.71
7.1.130.0030.01015.85
7.1.120.0130.00015.61
7.1.110.0000.01215.75
7.1.100.0020.01116.99
7.1.90.0030.01415.84
7.1.80.0000.00815.68
7.1.70.0030.00716.49
7.1.60.0090.01117.55
7.1.50.0090.00916.31
7.1.40.0000.01315.98
7.1.30.0000.00915.79
7.1.20.0130.00016.02
7.1.10.0040.01115.52
7.1.00.0080.03819.19
7.0.330.0030.01015.33
7.0.320.0030.01015.53
7.0.310.0000.01115.42
7.0.300.0050.00515.36
7.0.290.0040.01215.18
7.0.280.0030.00915.12
7.0.270.0060.00915.54
7.0.260.0040.00415.51
7.0.250.0000.00915.37
7.0.240.0030.01015.60
7.0.230.0070.00715.38
7.0.220.0040.00415.41
7.0.210.0030.00915.63
7.0.200.0050.00716.19
7.0.190.0050.00515.38
7.0.180.0090.00315.46
7.0.170.0060.00315.34
7.0.160.0080.00815.49
7.0.150.0070.00315.56
7.0.140.0040.00715.50
7.0.130.0070.00715.41
7.0.120.0000.01015.12
7.0.110.0000.01115.46
7.0.100.0040.01215.34
7.0.90.0090.00315.39
7.0.80.0000.00815.27
7.0.70.0000.00815.50
7.0.60.0150.04018.60
7.0.50.0020.04016.67
7.0.40.0030.02416.85
7.0.30.0120.02516.90
7.0.20.0170.04516.78
7.0.10.0090.04416.72
7.0.00.0030.04616.65
5.6.400.0030.00614.24
5.6.390.0040.00414.27
5.6.380.0070.00714.32
5.6.370.0100.00713.93
5.6.360.0040.01114.11
5.6.350.0040.01114.18
5.6.340.0030.00614.36
5.6.330.0060.00914.24
5.6.320.0030.00714.26
5.6.310.0030.01214.27
5.6.300.0000.00814.41
5.6.290.0000.01014.12
5.6.280.0080.02617.63
5.6.270.0070.00714.28
5.6.260.0040.00714.19
5.6.250.0040.01114.15
5.6.240.0070.00714.20
5.6.230.0070.00714.11
5.6.220.0070.00713.86
5.6.210.0000.02917.25
5.6.200.0070.04016.12
5.6.190.0070.04417.23
5.6.180.0120.02717.25
5.6.170.0130.02717.23
5.6.160.0030.03917.41
5.6.150.0060.04316.07
5.6.140.0020.03116.18
5.6.130.0070.02216.14
5.6.120.0080.04217.49
5.6.110.0030.04317.59
5.6.100.0070.03017.43
5.6.90.0080.04017.55
5.6.80.0050.03517.15
5.6.70.0000.01614.11
5.6.60.0040.01114.00
5.6.50.0030.00913.69
5.6.40.0000.00814.20
5.6.30.0070.00713.88
5.6.20.0070.00714.09
5.6.10.0000.00814.08
5.6.00.0000.01214.06
5.5.380.0090.00914.25
5.5.370.0030.01014.30
5.5.360.0050.00513.77
5.5.350.0160.02817.09
5.5.340.0110.03715.87
5.5.330.0090.04117.42
5.5.320.0300.04117.20
5.5.310.0050.03017.15
5.5.300.0030.04515.92
5.5.290.0080.02516.03
5.5.280.0040.03417.41
5.5.270.0000.02817.56
5.5.260.0050.04517.26
5.5.250.0050.04717.38
5.5.240.0070.02217.13
5.5.230.0110.00314.13
5.5.220.0000.01414.14
5.5.210.0100.00314.13
5.5.200.0100.00313.84
5.5.190.0050.00314.15
5.5.180.0110.00014.18
5.5.170.0030.00713.95
5.5.160.0070.00713.77
5.5.150.0070.00713.94
5.5.140.0140.00314.16
5.5.130.0060.00613.88
5.5.120.0030.00613.62
5.5.110.0040.00714.02
5.5.100.0060.00614.13
5.5.90.0030.00914.08
5.5.80.0000.00913.90
5.5.70.0030.01013.88
5.5.60.0030.00914.12
5.5.50.0090.00614.18
5.5.40.0000.01614.14
5.5.30.0000.01413.82
5.5.20.0000.01113.90
5.5.10.0060.00614.09
5.5.00.0070.00313.88

preferences:
54.35 ms | 400 KiB | 5 Q