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 = array( 'foo' => 'Hello World', /*'bar' => function (&$this) { $this['foo'] = 'Hi!'; },*/ 'baz' => 3 ); $obj = create(myClass); echo(call($obj, 'foo')); call($obj, 'bar'); 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.0060.01316.50
8.3.50.0070.00921.14
8.3.40.0040.01118.65
8.3.30.0140.00018.82
8.3.20.0040.00420.21
8.3.10.0050.00323.61
8.3.00.0080.00023.61
8.2.180.0080.00816.75
8.2.170.0170.00322.96
8.2.160.0030.01020.52
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00421.06
8.2.120.0030.00626.35
8.2.110.0090.00321.02
8.2.100.0090.00318.04
8.2.90.0000.00819.27
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0050.00322.36
8.2.30.0070.00019.58
8.2.20.0030.00617.82
8.2.10.0040.00418.19
8.2.00.0030.00518.16
8.1.280.0140.00725.92
8.1.270.0070.01122.23
8.1.260.0080.00028.09
8.1.250.0030.00628.09
8.1.240.0030.00622.54
8.1.230.0110.00019.10
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0060.00317.47
8.1.190.0050.00317.25
8.1.180.0000.00818.10
8.1.170.0040.00418.62
8.1.160.0000.00820.84
8.1.150.0050.00518.89
8.1.140.0040.00419.45
8.1.130.0030.00317.66
8.1.120.0000.00717.46
8.1.110.0040.00417.48
8.1.100.0000.00717.40
8.1.90.0000.00817.36
8.1.80.0000.00717.47
8.1.70.0000.00717.38
8.1.60.0040.00417.48
8.1.50.0060.00317.52
8.1.40.0060.00317.60
8.1.30.0030.00517.50
8.1.20.0060.00317.66
8.1.10.0050.00317.60
8.1.00.0000.00817.57
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0070.00018.42
8.0.270.0000.00717.27
8.0.260.0030.00317.30
8.0.250.0040.00417.05
8.0.240.0000.00716.93
8.0.230.0000.00817.02
8.0.220.0040.00416.99
8.0.210.0030.00616.96
8.0.200.0070.00017.11
8.0.190.0070.00016.94
8.0.180.0050.00316.88
8.0.170.0070.00016.88
8.0.160.0020.00516.91
8.0.150.0070.00416.93
8.0.140.0040.00416.90
8.0.130.0050.00013.44
8.0.120.0000.00916.88
8.0.110.0000.00716.95
8.0.100.0040.00416.92
8.0.90.0040.00416.96
8.0.80.0080.00816.94
8.0.70.0000.00716.84
8.0.60.0040.00416.97
8.0.50.0000.00716.79
8.0.30.0130.00317.30
8.0.20.0080.01417.40
8.0.10.0050.00217.11
8.0.00.0100.00816.74
7.4.330.0030.00316.83
7.4.320.0000.00616.61
7.4.300.0060.00016.53
7.4.290.0030.00516.46
7.4.280.0090.00016.52
7.4.270.0040.00416.66
7.4.260.0070.00016.41
7.4.250.0080.00016.50
7.4.240.0030.00316.45
7.4.230.0050.00316.64
7.4.220.0120.00416.46
7.4.210.0100.01016.67
7.4.200.0070.00016.72
7.4.160.0090.00616.47
7.4.150.0120.00617.40
7.4.140.0080.01217.86
7.4.130.0120.00616.55
7.4.120.0070.00916.56
7.4.110.0100.00716.54
7.4.100.0110.01116.64
7.4.90.0140.00916.45
7.4.80.0150.00719.39
7.4.70.0090.01416.75
7.4.60.0060.00916.39
7.4.50.0000.01516.36
7.4.40.0120.00916.63
7.4.30.0130.00916.41
7.4.00.0120.00015.13
7.3.330.0060.00013.43
7.3.320.0050.00013.45
7.3.310.0000.00716.46
7.3.300.0070.00016.47
7.3.290.0090.00616.46
7.3.280.0100.00716.46
7.3.270.0110.00717.40
7.3.260.0130.00316.49
7.3.240.0100.00716.51
7.3.230.0100.00916.64
7.3.210.0080.00816.52
7.3.200.0090.00919.39
7.3.190.0060.01216.56
7.3.180.0090.01216.48
7.3.170.0120.00616.54
7.3.160.0150.00316.56
7.3.10.0060.00316.30
7.3.00.0210.00315.87
7.2.330.0090.00916.81
7.2.320.0080.01416.85
7.2.310.0110.00916.43
7.2.300.0070.01416.53
7.2.290.0000.01516.77
7.2.130.0230.00816.44
7.2.120.0130.00316.59
7.2.110.0120.00316.68
7.2.100.0000.00916.95
7.2.90.0060.00916.66
7.2.80.0060.00916.99
7.2.70.0150.00616.71
7.2.60.0040.00716.94
7.2.50.0070.00316.87
7.2.40.0100.00316.78
7.2.30.0060.00816.73
7.2.20.0110.00817.00
7.2.10.0030.01316.45
7.2.00.0060.00616.81
7.1.250.0110.00315.59
7.1.200.0040.01115.86
7.1.70.0000.00817.19
7.1.60.0130.01319.40
7.1.50.0040.01816.62
7.1.00.0000.08022.45
7.0.200.0000.00816.69
7.0.60.0000.08721.64
7.0.50.0030.06718.01
7.0.40.0130.07320.13
7.0.30.0300.07020.16
7.0.20.0300.07720.08
7.0.10.0100.05320.09
7.0.00.0030.04320.16
5.6.280.0000.05721.04
5.6.210.0100.07720.65
5.6.200.0130.06318.18
5.6.190.0100.04320.51
5.6.180.0300.06320.50
5.6.170.0330.07720.49
5.6.160.0130.03320.46
5.6.150.0070.07718.15
5.6.140.0100.04018.18
5.6.130.0100.06018.17
5.6.120.0030.05021.00
5.6.110.0170.06021.13
5.6.100.0100.06021.05
5.6.90.0100.08020.98
5.6.80.0030.03720.39
5.5.350.2430.03320.54
5.5.340.0070.06718.09
5.5.330.0100.08020.43
5.5.320.0700.06020.39
5.5.310.0200.03720.31
5.5.300.0130.05317.97
5.5.290.0070.04717.92
5.5.280.0130.08020.96
5.5.270.0000.09320.80
5.5.260.0170.07020.65
5.5.250.0100.04320.47
5.5.240.0100.04720.04

preferences:
52.49 ms | 401 KiB | 5 Q