3v4l.org

run code in 300+ PHP versions simultaneously
<?php function struct(string $name, array $class) { $class = json_encode($class); define($name, $class); } function create($class) { $object = (array) json_decode($class); //if(function_exists($object['__construct']())) $object['__construct']($object); return $object; } function call(array &$class, string $member, ...$args) { if(!isset($class[$member])) exit($member.' is not a member of the class.'); else { if(!isset($args[0])) call_user_func('$class["'.$member.'"]($class)'); else call_user_func($class[$member]($class, $args)); } } struct('myStruct', [ 'foo' => 'Hello World!', 'bar' => function (array &$this) { echo(' Hi!'); } ]); $obj = create(myStruct); call($obj, 'bar');

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.0040.01116.50
8.3.50.0130.00521.02
8.3.40.0040.01118.56
8.3.30.0040.01118.57
8.3.20.0070.00020.26
8.3.10.0040.00421.95
8.3.00.0000.00721.91
8.2.180.0160.00616.36
8.2.170.0070.00722.96
8.2.160.0140.00720.57
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00821.11
8.2.120.0000.00726.35
8.2.110.0090.00020.96
8.2.100.0040.00817.92
8.2.90.0000.00819.10
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0040.00417.68
8.2.50.0030.00518.09
8.2.40.0050.00322.30
8.2.30.0000.00719.38
8.2.20.0040.00417.55
8.2.10.0030.00517.93
8.2.00.0070.00018.05
8.1.280.0070.00725.92
8.1.270.0080.00022.14
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0090.00022.35
8.1.230.0080.00419.17
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0050.00517.22
8.1.190.0080.00016.86
8.1.180.0040.00418.10
8.1.170.0030.00518.46
8.1.160.0040.00420.70
8.1.150.0040.00420.46
8.1.140.0050.00319.51
8.1.130.0030.00317.59
8.1.120.0000.00817.39
8.1.110.0080.00017.32
8.1.100.0000.00717.23
8.1.90.0000.01017.28
8.1.80.0070.00017.33
8.1.70.0030.00317.24
8.1.60.0000.00817.46
8.1.50.0040.00417.36
8.1.40.0040.00417.30
8.1.30.0030.00517.45
8.1.20.0050.00317.41
8.1.10.0040.00417.42
8.1.00.0040.00417.31
8.0.300.0030.00618.77
8.0.290.0060.00316.63
8.0.280.0040.00418.33
8.0.270.0050.00317.09
8.0.260.0000.00617.05
8.0.250.0060.00016.83
8.0.240.0000.00616.84
8.0.230.0000.00716.91
8.0.220.0040.00416.85
8.0.210.0000.00716.73
8.0.200.0050.00216.94
8.0.190.0060.00316.91
8.0.180.0070.00016.83
8.0.170.0050.00316.77
8.0.160.0040.00416.84
8.0.150.0090.00016.67
8.0.140.0040.00416.77
8.0.130.0060.00013.31
8.0.120.0040.00416.86
8.0.110.0030.00616.70
8.0.100.0060.00316.86
8.0.90.0000.00716.83
8.0.80.0090.00616.77
8.0.70.0050.00316.69
8.0.60.0030.00516.88
8.0.50.0000.00716.79
8.0.30.0140.00417.17
8.0.20.0050.01417.40
8.0.10.0040.00416.75
8.0.00.0080.01116.80
7.4.330.0050.00016.67
7.4.320.0000.00616.48
7.4.300.0050.00316.34
7.4.290.0070.00016.38
7.4.280.0000.00816.52
7.4.270.0030.00316.50
7.4.260.0000.00716.43
7.4.250.0040.00416.34
7.4.240.0070.00016.39
7.4.230.0030.00316.60
7.4.220.0090.00916.36
7.4.210.0040.01116.40
7.4.200.0070.00016.27
7.4.160.0100.01016.49
7.4.150.0060.01217.40
7.4.140.0050.01617.86
7.4.130.0120.00816.45
7.4.120.0050.01416.44
7.4.110.0120.00616.52
7.4.100.0030.01316.27
7.4.90.0140.00316.39
7.4.80.0150.00219.39
7.4.70.0090.00916.40
7.4.60.0090.00916.46
7.4.50.0060.00616.35
7.4.40.0120.00616.43
7.4.30.0110.00616.41
7.4.00.0060.00615.03
7.3.330.0000.00613.32
7.3.320.0030.00313.05
7.3.310.0030.00316.30
7.3.300.0040.00416.11
7.3.290.0000.00616.22
7.3.280.0080.01016.20
7.3.270.0100.00717.40
7.3.260.0190.00616.26
7.3.250.0100.00616.27
7.3.240.0120.00816.32
7.3.230.0100.01016.39
7.3.210.0130.00316.52
7.3.200.0030.02019.39
7.3.190.0060.01016.27
7.3.180.0090.01216.51
7.3.170.0100.00816.33
7.3.160.0060.00916.32
7.3.120.0030.01514.57
7.3.110.0000.01714.50
7.3.100.0060.00914.62
7.3.90.0080.00414.84
7.3.80.0140.00014.78
7.3.70.0100.00314.77
7.3.60.0050.00514.48
7.3.50.0030.01014.65
7.3.40.0060.00714.78
7.3.30.0110.00414.65
7.3.20.0100.00316.41
7.3.10.0100.00316.28
7.3.00.0120.00616.53
7.2.330.0060.01016.21
7.2.320.0090.00916.48
7.2.310.0090.00916.36
7.2.300.0080.00816.41
7.2.290.0100.00716.26
7.2.240.0060.01315.05
7.2.230.0120.00414.72
7.2.220.0030.00914.67
7.2.210.0070.00714.86
7.2.200.0130.00714.62
7.2.190.0000.01114.95
7.2.180.0100.00614.77
7.2.170.0120.00614.68
7.2.160.0060.00914.86
7.2.150.0070.00716.41
7.2.140.0060.00916.76
7.2.130.0070.01016.65
7.2.120.0060.00316.74
7.2.110.0000.00916.62
7.2.100.0060.00616.76
7.2.90.0130.00316.68
7.2.80.0030.01316.82
7.2.70.0070.00716.90
7.2.60.0030.01216.72
7.2.50.0070.00716.39
7.2.40.0120.00316.89
7.2.30.0030.01516.68
7.2.20.0110.00416.57
7.2.10.0060.01016.35
7.2.00.0070.00918.02
7.1.330.0100.00715.57
7.1.320.0040.00815.74
7.1.310.0060.00615.23
7.1.300.0140.00015.50
7.1.290.0000.01415.68
7.1.280.0070.00715.62
7.1.270.0000.01015.50
7.1.260.0120.00015.50
7.1.250.0030.01015.77
7.1.200.0070.00015.65
7.1.100.0080.00317.73
7.1.70.0000.00717.00
7.1.60.0030.02219.40
7.1.50.0070.00416.89
7.1.00.0100.07022.31
7.0.200.0030.00616.57
7.0.90.0600.08719.93
7.0.80.0700.07320.04
7.0.70.0570.08720.02
7.0.60.0500.08719.97
7.0.50.0600.08020.31
7.0.40.0300.06720.16
7.0.30.0030.05720.18
7.0.20.0270.05020.18
7.0.10.0170.07320.03
7.0.00.0070.06320.04
5.6.280.0030.05020.86
5.6.240.0170.07720.64
5.6.230.0100.07320.76
5.6.220.0030.04320.63
5.6.210.0030.07720.56
5.6.200.0030.08720.94
5.6.190.0130.03321.03
5.6.180.0130.07721.12
5.6.170.0030.05321.12
5.6.160.0000.09021.07
5.6.150.0070.07720.95
5.6.140.0070.05021.01
5.6.130.0030.06721.05
5.6.120.0070.05721.02
5.6.110.0130.03720.97
5.6.100.0100.06721.08
5.6.90.0130.08021.07
5.6.80.0270.05720.50
5.6.70.0100.04320.35
5.6.60.0100.07720.34
5.6.50.0100.08320.47
5.6.40.0070.07720.29
5.6.30.0100.07320.30
5.6.20.0070.08020.41
5.6.10.0070.07720.47
5.6.00.0100.07320.31
5.5.380.0130.07020.35
5.5.370.0100.06720.46
5.5.360.0070.08720.41
5.5.350.0170.06320.48
5.5.340.0130.07720.74
5.5.330.0130.07320.88
5.5.320.0030.04320.88
5.5.310.0070.08020.89
5.5.300.0070.05720.73
5.5.290.0030.06320.88
5.5.280.0170.07720.83
5.5.270.0070.08720.88
5.5.260.0200.07020.82
5.5.250.0030.06020.46
5.5.240.0070.08320.25
5.5.230.0070.08320.27
5.5.220.0100.04720.25
5.5.210.0070.08020.10
5.5.200.0000.05020.27
5.5.190.0130.05320.00
5.5.180.0030.06020.28
5.5.160.0070.05020.29
5.5.150.0130.07020.12
5.5.140.0100.04320.12
5.5.130.0130.07320.21
5.5.120.0170.07320.12
5.5.110.0130.07720.09
5.5.100.0100.05320.06
5.5.90.0030.07020.07
5.5.80.0000.09020.11
5.5.70.0100.05719.93
5.5.60.0170.07020.09
5.5.50.0030.06320.16
5.5.40.0170.07320.06
5.5.30.0170.07020.00
5.5.20.0030.05020.08
5.5.10.0000.05320.05
5.5.00.0100.03720.02

preferences:
62.47 ms | 401 KiB | 5 Q