3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); class Foo { /** * Values * @var array */ const VALUES = [ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' ]; /** * Test function */ public function execute() { $key = 'key4'; if (!empty(self::VALUES[$key])) { self::VALUES[$key]; } else { echo 'The key doesn\'t found in this array.'; } } } $foo = new Foo(); $foo->execute();

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.40.0070.00718.50
8.3.30.0070.00718.53
8.3.20.0000.00721.94
8.3.10.0080.00021.57
8.3.00.0040.00419.35
8.2.170.0120.00622.96
8.2.160.0140.00020.11
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00818.19
8.2.120.0000.00726.35
8.2.110.0030.00620.38
8.2.100.0090.00317.91
8.2.90.0040.00417.91
8.2.80.0000.00919.40
8.2.70.0040.00417.93
8.2.60.0040.00417.93
8.2.50.0030.00618.16
8.2.40.0000.00822.04
8.2.30.0050.00219.31
8.2.20.0040.00618.02
8.2.10.0070.00418.17
8.2.00.0000.00718.18
8.1.270.0090.00022.14
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.50
8.1.230.0110.00322.66
8.1.220.0050.00317.76
8.1.210.0000.01018.77
8.1.200.0000.00817.23
8.1.190.0050.00317.11
8.1.180.0000.00818.10
8.1.170.0040.00420.42
8.1.160.0070.00018.89
8.1.150.0050.00220.18
8.1.140.0040.00417.71
8.1.130.0000.00818.96
8.1.120.0040.00417.51
8.1.110.0040.00417.49
8.1.100.0040.00417.47
8.1.90.0000.00717.35
8.1.80.0030.00617.51
8.1.70.0000.00717.52
8.1.60.0040.00417.59
8.1.50.0040.00417.55
8.1.40.0000.00817.55
8.1.30.0110.00017.66
8.1.20.0030.00617.57
8.1.10.0000.00717.53
8.1.00.0040.00417.55
8.0.300.0000.00719.97
8.0.290.0030.00616.63
8.0.280.0000.00718.36
8.0.270.0060.00317.20
8.0.260.0030.00316.82
8.0.250.0050.00216.96
8.0.240.0030.00316.96
8.0.230.0000.00916.85
8.0.220.0000.00916.90
8.0.210.0000.00716.89
8.0.200.0070.00316.93
8.0.190.0080.00017.00
8.0.180.0070.00016.81
8.0.170.0040.00416.89
8.0.160.0030.00616.73
8.0.150.0000.00716.85
8.0.140.0050.00316.87
8.0.130.0030.00313.38
8.0.120.0050.00216.77
8.0.110.0000.00816.87
8.0.100.0050.00216.77
8.0.90.0000.00716.72
8.0.80.0100.00616.89
8.0.70.0050.00316.75
8.0.60.0040.00417.01
8.0.50.0040.00416.83
8.0.30.0070.01317.02
8.0.20.0110.01117.41
8.0.10.0030.00516.89
8.0.00.0090.00916.83
7.4.330.0000.00515.55
7.4.320.0000.00616.61
7.4.300.0030.00316.55
7.4.290.0030.00316.61
7.4.280.0040.00416.58
7.4.270.0050.00516.57
7.4.260.0030.00316.48
7.4.250.0050.00316.46
7.4.240.0050.00216.50
7.4.230.0070.00016.54
7.4.220.0040.00416.32
7.4.210.0000.01516.68
7.4.200.0030.00316.54
7.4.160.0100.00816.49
7.4.150.0180.00617.40
7.4.140.0110.00817.86
7.4.130.0100.01616.38
7.4.120.0100.00716.53
7.4.110.0100.00716.66
7.4.100.0070.01016.41
7.4.90.0130.01016.38
7.4.80.0060.01619.39
7.4.70.0000.01916.60
7.4.60.0060.00916.61
7.4.50.0100.00216.24
7.4.40.0120.00416.43
7.4.00.0040.01215.18
7.3.330.0050.00013.25
7.3.320.0000.00613.22
7.3.310.0030.00316.34
7.3.300.0000.00616.27
7.3.290.0080.01016.25
7.3.280.0080.00716.20
7.3.270.0110.00717.40
7.3.260.0140.00816.37
7.3.240.0090.00816.28
7.3.230.0120.00416.37
7.3.210.0100.00716.47
7.3.200.0120.00616.49
7.3.190.0100.00716.34
7.3.180.0070.01016.27
7.3.170.0030.01316.30
7.3.160.0110.00416.60
7.2.330.0030.01616.73
7.2.320.0090.00916.81
7.2.310.0030.01316.62
7.2.300.0100.00616.75
7.2.290.0030.01516.64
7.2.60.0060.00616.87
7.2.20.0110.01418.66
7.2.10.0180.01418.44
7.2.00.0140.01418.43
7.1.200.0070.00715.64
7.1.140.0110.01117.38
7.1.130.0130.01117.23
7.1.120.0140.01517.38
7.1.110.0120.01316.96
7.1.100.0120.01316.75
7.1.90.0110.01216.76
7.1.80.0120.01116.85
7.1.70.0100.01115.73
7.1.60.1130.01533.73
7.1.50.0330.01633.42
7.1.40.0320.01933.07
7.1.30.0340.01333.21
7.1.20.0270.01533.29
7.1.10.0360.01215.30
7.1.00.0090.01215.34

preferences:
62.32 ms | 400 KiB | 5 Q