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.63
8.3.50.0100.00921.25
8.3.40.0070.01018.71
8.3.30.0040.01218.71
8.3.20.0070.00020.39
8.3.10.0040.00421.60
8.3.00.0070.00021.90
8.2.180.0130.00716.38
8.2.170.0070.01322.96
8.2.160.0130.00720.35
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00021.18
8.2.120.0070.00026.35
8.2.110.0060.00320.75
8.2.100.0070.00417.68
8.2.90.0040.00419.00
8.2.80.0050.00317.97
8.2.70.0000.00817.25
8.2.60.0040.00417.68
8.2.50.0000.00918.09
8.2.40.0040.00422.32
8.2.30.0000.00719.36
8.2.20.0030.00617.57
8.2.10.0050.00218.01
8.2.00.0000.00717.83
8.1.280.0150.00025.92
8.1.270.0040.00422.14
8.1.260.0040.00428.09
8.1.250.0050.00228.09
8.1.240.0100.00022.34
8.1.230.0070.00419.10
8.1.220.0000.00917.74
8.1.210.0050.00318.77
8.1.200.0060.00317.11
8.1.190.0030.00517.00
8.1.180.0000.00818.10
8.1.170.0040.00418.50
8.1.160.0040.00420.53
8.1.150.0000.00720.54
8.1.140.0000.00819.47
8.1.130.0070.00017.59
8.1.120.0000.00717.33
8.1.110.0000.00817.39
8.1.100.0000.00717.32
8.1.90.0030.00617.36
8.1.80.0040.00417.32
8.1.70.0000.00717.38
8.1.60.0060.00317.31
8.1.50.0040.00417.36
8.1.40.0000.00817.46
8.1.30.0000.00817.54
8.1.20.0050.00317.46
8.1.10.0000.00717.45
8.1.00.0080.00017.35
8.0.300.0060.00318.77
8.0.290.0000.00816.75
8.0.280.0000.00818.39
8.0.270.0030.00317.13
8.0.260.0030.00317.15
8.0.250.0030.00316.90
8.0.240.0060.00016.92
8.0.230.0030.00316.92
8.0.220.0000.00816.84
8.0.210.0000.00716.68
8.0.200.0040.00416.91
8.0.190.0090.00016.89
8.0.180.0070.00016.84
8.0.170.0040.00416.89
8.0.160.0040.00416.83
8.0.150.0050.00516.65
8.0.140.0040.00416.64
8.0.130.0060.00013.15
8.0.120.0040.00416.70
8.0.110.0040.00416.82
8.0.100.0000.00716.69
8.0.90.0040.00416.74
8.0.80.0110.00416.91
8.0.70.0070.00016.72
8.0.60.0000.00716.75
8.0.50.0000.00716.80
8.0.30.0080.00917.02
8.0.20.0110.00917.40
8.0.10.0040.00417.00
8.0.00.0060.01216.55
7.4.330.0020.00216.82
7.4.320.0060.00016.37
7.4.300.0040.00416.53
7.4.290.0040.00416.54
7.4.280.0050.00316.48
7.4.270.0000.00716.47
7.4.260.0000.00816.48
7.4.250.0000.00716.37
7.4.240.0030.00316.41
7.4.230.0000.00716.28
7.4.220.0040.01516.41
7.4.210.0060.00916.42
7.4.200.0070.00016.59
7.4.160.0130.00716.41
7.4.150.0140.00617.40
7.4.140.0120.00817.86
7.4.130.0100.00816.53
7.4.120.0110.00616.31
7.4.110.0090.00916.37
7.4.100.0060.01016.52
7.4.90.0030.01416.20
7.4.80.0090.00919.39
7.4.70.0090.00616.48
7.4.60.0060.01016.45
7.4.50.0120.00616.39
7.4.40.0060.01716.40
7.4.30.0060.01116.34
7.4.10.0070.00714.80
7.4.00.0070.00914.88
7.3.330.0000.00513.07
7.3.320.0000.00813.11
7.3.310.0040.00416.12
7.3.300.0060.00016.28
7.3.290.0030.00316.13
7.3.280.0060.01116.23
7.3.270.0040.01217.40
7.3.260.0100.01316.42
7.3.250.0110.00616.33
7.3.240.0090.01116.30
7.3.230.0110.00616.39
7.3.210.0080.00816.38
7.3.200.0170.00019.39
7.3.190.0040.01416.35
7.3.180.0060.01316.30
7.3.170.0120.01216.44
7.3.160.0090.00616.19
7.3.130.0100.00914.68
7.3.120.0100.01014.83
7.3.110.0090.00914.74
7.3.100.0080.00814.70
7.3.90.0000.01114.80
7.3.80.0070.00314.46
7.3.70.0040.01114.61
7.3.60.0030.01014.79
7.3.50.0100.00714.49
7.3.40.0090.00314.62
7.3.30.0000.01414.68
7.3.20.0060.00316.42
7.3.10.0000.01116.68
7.3.00.0080.00016.70
7.2.330.0090.00916.59
7.2.320.0060.01616.34
7.2.310.0030.01616.54
7.2.300.0120.00616.39
7.2.290.0050.01016.30
7.2.260.0070.01014.77
7.2.250.0040.01414.70
7.2.240.0000.01314.68
7.2.230.0040.00814.78
7.2.220.0080.00615.07
7.2.210.0000.01114.64
7.2.200.0140.00014.73
7.2.190.0060.00914.87
7.2.180.0110.00614.85
7.2.170.0030.01214.92
7.2.160.0030.01214.77
7.2.150.0000.01016.92
7.2.140.0030.01016.70
7.2.130.0030.00616.65
7.2.120.0000.01316.64
7.2.110.0070.00716.78
7.2.100.0060.00316.46
7.2.90.0000.01016.90
7.2.80.0070.00716.70
7.2.70.0040.01116.88
7.2.60.0040.01216.66
7.2.50.0060.01216.72
7.2.40.0030.01016.84
7.2.30.0130.00616.63
7.2.20.0130.00316.55
7.2.10.0070.00416.77
7.2.00.0070.00917.99
7.1.330.0030.01015.43
7.1.320.0060.00615.35
7.1.310.0040.01115.72
7.1.300.0030.01215.59
7.1.290.0070.00415.60
7.1.280.0000.01115.78
7.1.270.0060.00915.40
7.1.260.0060.00915.55
7.1.250.0000.01015.53
7.1.240.0040.01115.53
7.1.230.0070.00715.61
7.1.220.0000.00815.53
7.1.210.0070.01015.63
7.1.200.0050.00815.63
7.1.190.0080.00815.38
7.1.180.0090.00615.30
7.1.170.0100.00715.59
7.1.160.0040.00815.37
7.1.150.0080.00615.30
7.1.140.0120.00415.45
7.1.130.0000.01215.48
7.1.120.0090.00915.31
7.1.110.0090.00915.72
7.1.100.0020.01216.62
7.1.90.0060.00615.59
7.1.80.0040.01115.78
7.1.70.0050.00716.12
7.1.60.0070.01317.49
7.1.50.0080.01016.29
7.1.40.0030.00615.72
7.1.30.0030.00915.52
7.1.20.0030.01215.63
7.1.10.0070.00415.69
7.1.00.0030.04019.07
7.0.330.0030.00615.07
7.0.320.0060.00615.11
7.0.310.0080.00415.08
7.0.300.0060.00915.13
7.0.290.0040.01215.32
7.0.280.0090.00614.91
7.0.270.0060.00615.00
7.0.260.0090.00315.15
7.0.250.0090.00915.35
7.0.240.0030.01415.30
7.0.230.0070.00715.35
7.0.220.0030.00915.21
7.0.210.0060.00915.32
7.0.200.0050.00515.90
7.0.190.0100.00015.31
7.0.180.0030.00515.05
7.0.170.0060.00915.20
7.0.160.0090.00315.42
7.0.150.0040.01115.26
7.0.140.0070.00715.25
7.0.130.0070.00415.43
7.0.120.0030.01015.05
7.0.110.0040.01115.37
7.0.100.0100.00315.31
7.0.90.0320.02517.59
7.0.80.0300.04517.53
7.0.70.0390.04017.60
7.0.60.0220.03517.64
7.0.50.0240.04617.94
7.0.40.0070.02816.84
7.0.30.0030.03616.66
7.0.20.0100.04316.76
7.0.10.0030.05016.85
7.0.00.0080.04316.71
5.6.400.0040.00814.46
5.6.390.0000.01214.48
5.6.380.0060.00614.51
5.6.370.0090.00614.24
5.6.360.0030.00714.44
5.6.350.0000.01214.32
5.6.340.0040.01014.37
5.6.330.0060.00614.20
5.6.320.0110.00414.12
5.6.310.0040.00914.41
5.6.300.0030.00614.44
5.6.290.0090.00614.33
5.6.280.0040.03017.53
5.6.270.0090.00014.25
5.6.260.0100.00014.07
5.6.250.0030.01414.28
5.6.240.0040.03117.42
5.6.230.0120.04017.34
5.6.220.0080.04117.42
5.6.210.0080.04717.34
5.6.200.0080.03017.55
5.6.190.0050.04817.67
5.6.180.0030.03317.46
5.6.170.0130.03717.72
5.6.160.0100.03817.63
5.6.150.0070.04317.58
5.6.140.0050.04917.75
5.6.130.0080.04317.49
5.6.120.0080.02317.63
5.6.110.0080.04517.67
5.6.100.0050.04417.64
5.6.90.0110.03817.55
5.6.80.0090.04317.37
5.6.70.0080.03117.29
5.6.60.0080.04117.26
5.6.50.0100.04017.22
5.6.40.0050.04217.22
5.6.30.0110.04017.46
5.6.20.0030.04717.26
5.6.10.0130.03317.18
5.6.00.0070.02517.15
5.5.380.0030.04717.32
5.5.370.0060.04317.24
5.5.360.0050.02817.02
5.5.350.0080.04417.24
5.5.340.0050.04717.38
5.5.330.0050.04417.37
5.5.320.0090.04417.35
5.5.310.0100.02717.45
5.5.300.0020.04817.37
5.5.290.0030.04817.58
5.5.280.0040.04917.41
5.5.270.0050.04917.45
5.5.260.0080.03817.43
5.5.250.0130.03917.42
5.5.240.0100.03916.98
5.5.230.0120.04617.02
5.5.220.0040.04817.02
5.5.210.0100.03916.90
5.5.200.0050.04517.13
5.5.190.0130.02317.02
5.5.180.0110.04116.99
5.5.170.0000.01114.09
5.5.160.0100.02716.91
5.5.150.0110.03616.99
5.5.140.0110.02916.97
5.5.130.0050.03016.88
5.5.120.0080.04017.00
5.5.110.0090.03217.17
5.5.100.0070.03316.94
5.5.90.0070.04317.09
5.5.80.0050.03217.07
5.5.70.0070.04517.02
5.5.60.0080.03316.96
5.5.50.0080.02717.05
5.5.40.0040.02417.01
5.5.30.0020.03316.96
5.5.20.0000.03017.06
5.5.10.0030.04616.79
5.5.00.0050.04517.07

preferences:
66.24 ms | 401 KiB | 5 Q