3v4l.org

run code in 300+ PHP versions simultaneously
<?php function create(array $class) { $array = []; foreach($class as $key => $value) { if(is_array($value)) $array =+ [$key => create($value)]; else $array += [$key => $value]; } return $array; } function call(array &$class, string $member, ...$args) { if(!isset($class[$member])) exit($member.' is not a member of the class.'); else { if(!is_callable($class[$member])) return $class[$member]; else { if(!isset($args[0])) $class[$member]($class); } } } const myClass = [ 'foo' => 'Hello World', 'baz' => 3 ]; $obj = create(myClass); echo(call($obj, 'foo')); echo(call($obj, 'foo'));

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.0070.01316.63
8.3.50.0110.00416.63
8.3.40.0090.00618.77
8.3.30.0040.01119.02
8.3.20.0050.00320.20
8.3.10.0030.00621.90
8.3.00.0040.00422.07
8.2.180.0190.00325.92
8.2.170.0150.00018.82
8.2.160.0060.00822.96
8.2.150.0050.00225.66
8.2.140.0040.00424.66
8.2.130.0080.00021.07
8.2.120.0080.00026.35
8.2.110.0110.00020.32
8.2.100.0090.00317.91
8.2.90.0040.00419.35
8.2.80.0040.00417.97
8.2.70.0090.00017.62
8.2.60.0050.00317.91
8.2.50.0030.00518.09
8.2.40.0000.00720.54
8.2.30.0040.00419.51
8.2.20.0000.00917.75
8.2.10.0070.00018.17
8.2.00.0020.00518.19
8.1.280.0120.00325.92
8.1.270.0120.00622.14
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0060.00323.95
8.1.230.0080.00321.03
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.13
8.1.190.0000.00817.23
8.1.180.0060.00318.10
8.1.170.0050.00318.40
8.1.160.0050.00320.77
8.1.150.0070.00018.89
8.1.140.0040.00419.55
8.1.130.0040.00417.76
8.1.120.0050.00217.51
8.1.110.0040.00417.38
8.1.100.0030.00517.53
8.1.90.0030.00617.36
8.1.80.0000.00817.49
8.1.70.0000.00717.43
8.1.60.0040.00417.58
8.1.50.0000.00817.47
8.1.40.0030.00517.52
8.1.30.0040.00417.68
8.1.20.0000.00817.68
8.1.10.0000.00717.59
8.1.00.0000.00817.44
8.0.300.0070.00018.77
8.0.290.0040.00416.73
8.0.280.0030.00318.50
8.0.270.0050.00517.32
8.0.260.0070.00017.14
8.0.250.0030.00316.94
8.0.240.0070.00016.91
8.0.230.0050.00216.93
8.0.220.0030.00316.98
8.0.210.0000.00816.94
8.0.200.0060.00016.92
8.0.190.0000.00717.03
8.0.180.0000.00916.99
8.0.170.0000.00817.04
8.0.160.0070.00016.88
8.0.150.0040.00417.04
8.0.140.0040.00416.89
8.0.130.0030.00313.46
8.0.120.0030.00516.90
8.0.110.0040.00416.94
8.0.100.0040.00417.04
8.0.90.0070.00016.93
8.0.80.0060.00916.91
8.0.70.0070.00016.94
8.0.60.0030.00516.84
8.0.50.0050.00317.05
8.0.30.0100.00617.16
8.0.20.0120.00617.40
8.0.10.0040.00417.04
8.0.00.0090.01216.87
7.4.330.0050.00016.83
7.4.320.0030.00316.53
7.4.300.0000.00716.63
7.4.290.0030.00316.50
7.4.280.0000.00816.50
7.4.270.0000.00716.54
7.4.260.0000.00816.52
7.4.250.0050.00216.59
7.4.240.0040.00416.53
7.4.230.0070.00016.52
7.4.220.0100.01316.56
7.4.210.0080.00616.45
7.4.200.0040.00416.71
7.4.160.0060.01116.61
7.4.150.0060.01217.40
7.4.140.0090.01317.86
7.4.130.0090.00916.49
7.4.120.0100.00716.47
7.4.110.0140.00416.64
7.4.100.0130.00516.52
7.4.90.0070.01016.65
7.4.80.0160.00419.39
7.4.70.0110.00716.50
7.4.60.0070.01116.38
7.4.50.0030.00916.19
7.4.40.0090.00916.40
7.4.30.0100.01016.69
7.4.10.0090.00615.04
7.4.00.0070.00914.89
7.3.330.0000.00513.39
7.3.320.0030.00313.41
7.3.310.0040.00416.29
7.3.300.0000.00716.24
7.3.290.0070.01016.35
7.3.280.0100.00816.36
7.3.270.0060.01117.40
7.3.260.0080.00816.63
7.3.250.0100.01116.33
7.3.240.0100.00716.42
7.3.230.0080.00916.40
7.3.210.0040.01916.57
7.3.200.0030.01519.39
7.3.190.0100.00916.40
7.3.180.0100.00716.47
7.3.170.0100.01316.40
7.3.160.0100.00616.41
7.3.130.0070.01015.16
7.3.120.0080.00815.11
7.3.110.0070.01014.59
7.3.100.0030.01214.66
7.3.90.0090.00614.88
7.3.80.0070.00714.89
7.3.70.0040.00714.92
7.3.60.0130.00314.91
7.3.50.0120.00414.84
7.3.40.0100.00314.95
7.3.30.0000.01114.94
7.3.20.0070.00716.63
7.3.10.0070.00716.61
7.3.00.0040.01116.76
7.2.330.0170.00616.80
7.2.320.0120.01216.48
7.2.310.0110.01116.85
7.2.300.0140.00316.71
7.2.290.0030.01316.82
7.2.260.0060.01215.31
7.2.250.0060.01115.02
7.2.240.0030.01214.92
7.2.230.0130.00315.09
7.2.220.0070.01114.75
7.2.210.0100.00315.33
7.2.200.0060.00915.02
7.2.190.0000.01415.22
7.2.180.0030.01015.03
7.2.170.0100.00615.08
7.2.160.0000.01515.00
7.2.150.0120.00616.65
7.2.140.0090.00916.68
7.2.130.0050.00816.86
7.2.120.0060.00916.97
7.2.110.0020.01316.91
7.2.100.0070.00716.89
7.2.90.0040.01117.09
7.2.80.0060.00717.07
7.2.70.0070.00517.05
7.2.60.0090.00516.86
7.2.50.0030.00917.04
7.2.40.0080.00816.94
7.2.30.0040.01117.05
7.2.20.0100.00617.08
7.2.10.0040.00916.91
7.2.00.0070.01017.77
7.1.330.0000.01215.47
7.1.320.0100.00315.83
7.1.310.0070.00715.83
7.1.300.0060.00815.76
7.1.290.0000.01315.97
7.1.280.0030.00715.97
7.1.270.0070.00715.80
7.1.260.0030.01515.87
7.1.250.0030.01015.58
7.1.240.0030.01115.69
7.1.230.0070.00715.78
7.1.220.0000.00915.94
7.1.210.0040.00815.94
7.1.200.0100.00315.66
7.1.190.0000.01015.80
7.1.180.0070.00415.71
7.1.170.0080.00015.75
7.1.160.0000.01315.72
7.1.150.0060.00315.79
7.1.140.0120.00015.99
7.1.130.0100.00315.47
7.1.120.0030.01715.84
7.1.110.0100.00615.99
7.1.100.0070.00617.01
7.1.90.0040.01215.96
7.1.80.0040.00415.93
7.1.70.0050.00516.48
7.1.60.0060.01117.45
7.1.50.0090.00616.44
7.1.40.0040.00715.61
7.1.30.0080.00315.77
7.1.20.0030.01015.62
7.1.10.0090.00615.67
7.1.00.0020.04519.10
7.0.330.0000.01015.34
7.0.320.0040.00415.33
7.0.310.0000.01215.19
7.0.300.0130.00015.42
7.0.290.0080.00415.33
7.0.280.0120.00015.37
7.0.270.0100.00715.43
7.0.260.0040.01115.28
7.0.250.0070.01315.58
7.0.240.0060.01015.48
7.0.230.0090.00615.50
7.0.220.0000.00915.62
7.0.210.0030.00515.43
7.0.200.0050.00716.11
7.0.190.0090.00615.55
7.0.180.0040.00815.64
7.0.170.0030.00615.40
7.0.160.0070.00715.43
7.0.150.0000.01215.56
7.0.140.0070.01015.49
7.0.130.0060.00615.30
7.0.120.0070.00715.59
7.0.110.0050.00515.55
7.0.100.0030.01315.43
7.0.90.0030.01015.52
7.0.80.0030.00915.42
7.0.70.0030.00915.46
7.0.60.0100.04218.54
7.0.50.0060.04016.78
7.0.40.0080.04316.73
7.0.30.0120.02216.77
7.0.20.0180.04316.78
7.0.10.0030.03516.84
7.0.00.0040.02316.90
5.6.400.0070.00714.48
5.6.390.0060.01014.58
5.6.380.0070.00714.57
5.6.370.0090.00614.70
5.6.360.0000.01414.36
5.6.350.0060.00314.39
5.6.340.0070.00714.30
5.6.330.0060.00614.53
5.6.320.0030.00914.30
5.6.310.0040.00714.23
5.6.300.0000.01414.56
5.6.290.0000.01214.35
5.6.280.0050.03717.63
5.6.270.0060.00914.11
5.6.260.0040.01114.43
5.6.250.0070.00714.60
5.6.240.0070.01014.23
5.6.230.0000.01114.65
5.6.220.0060.01014.32
5.6.210.0110.04117.67
5.6.200.0080.04516.29
5.6.190.0070.04317.52
5.6.180.0250.03817.50
5.6.170.0170.04617.41
5.6.160.0070.02217.69
5.6.150.0090.04016.25
5.6.140.0050.04216.20
5.6.130.0070.02016.19
5.6.120.0050.04517.72
5.6.110.0030.02317.77
5.6.100.0020.03017.56
5.6.90.0120.03717.75
5.6.80.0090.03917.25
5.6.70.0140.00014.22
5.6.60.0030.01014.23
5.6.50.0000.01014.55
5.6.40.0030.01214.47
5.6.30.0090.00314.19
5.6.20.0060.00614.32
5.6.10.0000.00914.23
5.6.00.0110.00414.08
5.5.380.0040.01114.21
5.5.370.0030.01213.99
5.5.360.0080.00814.19
5.5.350.2280.02217.26
5.5.340.0080.03515.94
5.5.330.0100.04017.27
5.5.320.0250.02517.21
5.5.310.0070.03317.15
5.5.300.0050.04715.95
5.5.290.0030.04516.01
5.5.280.0070.02817.52
5.5.270.0080.02817.49
5.5.260.0150.03617.52
5.5.250.0070.02817.43
5.5.240.0170.01817.11
5.5.230.0060.00314.12
5.5.220.0070.01013.68
5.5.210.0060.00314.11
5.5.200.0030.01114.07
5.5.190.0120.00313.80
5.5.180.0040.01213.92
5.5.170.0060.00313.96
5.5.160.0040.01513.80
5.5.150.0040.01113.77
5.5.140.0070.01013.97
5.5.130.0090.00614.00
5.5.120.0070.01013.97
5.5.110.0070.00713.83
5.5.100.0030.00913.90
5.5.90.0070.00313.73
5.5.80.0090.00614.12
5.5.70.0040.00813.96
5.5.60.0090.00613.79
5.5.50.0080.00414.05
5.5.40.0040.01114.32
5.5.30.0060.00914.00
5.5.20.0060.00913.95
5.5.10.0100.00314.16
5.5.00.0060.01213.91

preferences:
60.15 ms | 400 KiB | 5 Q