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(!is_callable($class[$member])) return $class[$member]; else { if(!isset($args[0])) $class[$member]($class); else $class[$member]($class, $args); } } } struct('myStruct', [ 'foo' => 'Hello World!', 'bar' => function (&$this) { echo(' Hi!'); } ]); $obj = create(myStruct); 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.70.0040.01118.17
8.3.60.0100.01016.63
8.3.50.0130.00521.14
8.3.40.0070.00718.84
8.3.30.0110.00318.72
8.3.20.0020.00520.51
8.3.10.0080.00023.60
8.3.00.0040.00423.66
8.2.190.0110.00716.63
8.2.180.0090.00918.18
8.2.170.0100.00322.96
8.2.160.0040.01120.34
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00020.87
8.2.120.0040.00426.35
8.2.110.0080.00020.94
8.2.100.0070.00317.80
8.2.90.0050.00319.07
8.2.80.0060.00317.97
8.2.70.0030.00617.50
8.2.60.0080.00017.80
8.2.50.0090.00018.09
8.2.40.0050.00322.28
8.2.30.0000.00719.25
8.2.20.0040.00417.68
8.2.10.0000.00717.82
8.2.00.0040.00418.00
8.1.280.0140.00025.92
8.1.270.0000.00922.14
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0070.00322.31
8.1.230.0120.00019.01
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0040.00817.23
8.1.190.0040.00416.98
8.1.180.0000.00818.10
8.1.170.0040.00418.56
8.1.160.0000.00720.69
8.1.150.0050.00218.73
8.1.140.0030.00519.36
8.1.130.0070.00017.59
8.1.120.0000.00717.34
8.1.110.0040.00417.35
8.1.100.0040.00417.26
8.1.90.0040.00417.22
8.1.80.0000.00717.36
8.1.70.0030.00317.30
8.1.60.0030.00517.35
8.1.50.0000.00817.39
8.1.40.0020.00517.26
8.1.30.0000.00817.55
8.1.20.0080.00017.47
8.1.10.0000.00717.36
8.1.00.0080.00017.33
8.0.300.0000.00718.77
8.0.290.0080.00016.63
8.0.280.0030.00318.38
8.0.270.0000.00717.07
8.0.260.0000.00717.19
8.0.250.0070.00016.84
8.0.240.0060.00016.92
8.0.230.0040.00417.00
8.0.220.0030.00316.82
8.0.210.0020.00516.84
8.0.200.0030.00316.90
8.0.190.0000.00816.80
8.0.180.0050.00316.91
8.0.170.0000.00916.87
8.0.160.0040.00416.97
8.0.150.0030.00316.88
8.0.140.0070.00016.82
8.0.130.0050.00013.22
8.0.120.0030.00516.66
8.0.110.0020.00516.77
8.0.100.0050.00316.74
8.0.90.0000.00816.64
8.0.80.0150.00016.83
8.0.70.0000.00816.69
8.0.60.0040.00416.81
8.0.50.0000.00816.84
8.0.30.0130.01016.95
8.0.20.0110.00717.40
8.0.10.0050.00216.86
8.0.00.0100.00716.64
7.4.330.0000.00516.70
7.4.320.0060.00016.35
7.4.300.0030.00516.51
7.4.290.0080.00016.36
7.4.280.0080.00016.38
7.4.270.0000.00716.29
7.4.260.0040.00416.38
7.4.250.0060.00316.34
7.4.240.0030.00416.31
7.4.230.0040.00416.51
7.4.220.0060.01216.50
7.4.210.0080.00916.46
7.4.200.0000.00716.20
7.4.160.0080.00816.49
7.4.150.0090.00917.40
7.4.140.0110.01217.86
7.4.130.0030.01316.43
7.4.120.0090.00816.46
7.4.110.0200.01016.41
7.4.100.0060.00916.35
7.4.90.0040.01216.41
7.4.80.0060.01719.39
7.4.70.0100.00716.45
7.4.60.0080.01016.50
7.4.50.0060.00616.30
7.4.40.0090.00916.24
7.4.30.0040.01416.62
7.4.10.0070.01014.88
7.4.00.0060.00914.97
7.3.330.0030.00313.24
7.3.320.0030.00313.26
7.3.310.0020.00516.09
7.3.300.0030.00316.27
7.3.290.0000.00616.25
7.3.280.0100.00916.21
7.3.270.0060.01217.40
7.3.260.0060.01216.58
7.3.250.0090.00916.24
7.3.240.0120.00516.23
7.3.230.0090.00616.39
7.3.210.0130.01016.36
7.3.200.0120.00616.25
7.3.190.0100.00616.51
7.3.180.0030.01716.32
7.3.170.0030.01716.27
7.3.160.0030.01316.40
7.3.130.0070.00914.59
7.3.120.0090.00714.73
7.3.110.0100.00714.77
7.3.100.0030.01014.75
7.3.90.0060.00414.78
7.3.80.0070.00714.62
7.3.70.0070.00814.54
7.3.60.0040.01214.69
7.3.50.0090.00614.62
7.3.40.0070.00514.76
7.3.30.0080.00614.73
7.3.20.0040.00816.43
7.3.10.0060.00716.58
7.3.00.0090.00516.61
7.2.330.0090.00916.46
7.2.320.0060.01216.32
7.2.310.0100.01316.49
7.2.300.0040.01716.51
7.2.290.0070.01016.43
7.2.260.0070.01014.88
7.2.250.0050.01214.87
7.2.240.0050.01114.87
7.2.230.0050.00914.77
7.2.220.0080.00414.94
7.2.210.0020.01414.77
7.2.200.0060.00814.91
7.2.190.0040.00814.76
7.2.180.0020.01114.81
7.2.170.0050.00814.84
7.2.160.0030.01114.68
7.2.150.0030.01016.75
7.2.140.0060.00316.50
7.2.130.0020.01816.79
7.2.120.0050.00816.67
7.2.110.0040.00816.70
7.2.100.0070.00916.66
7.2.90.0060.00716.78
7.2.80.0070.00616.71
7.2.70.0060.00916.58
7.2.60.0030.01116.80
7.2.50.0030.00916.63
7.2.40.0060.00716.72
7.2.30.0060.00816.76
7.2.20.0060.00316.71
7.2.10.0040.00916.55
7.2.00.0070.00617.61
7.1.330.0070.00715.38
7.1.320.0050.00715.57
7.1.310.0020.01115.50
7.1.300.0080.00615.55
7.1.290.0080.00515.61
7.1.280.0050.00815.45
7.1.270.0100.00515.66
7.1.260.0000.01315.48
7.1.250.0050.01315.55
7.1.240.0060.00715.58
7.1.230.0090.00415.48
7.1.220.0040.00715.56
7.1.210.0030.01115.54
7.1.200.0070.00615.61
7.1.190.0090.00515.61
7.1.180.0020.01215.62
7.1.170.0080.00515.48
7.1.160.0060.01115.50
7.1.150.0060.00415.73
7.1.140.0030.00815.57
7.1.130.0030.01215.62
7.1.120.0050.00715.64
7.1.110.0070.00315.61
7.1.100.0040.00716.25
7.1.90.0090.00615.64
7.1.80.0020.01115.59
7.1.70.0040.00515.90
7.1.60.0090.00816.90
7.1.50.0080.00715.96
7.1.40.0080.00515.45
7.1.30.0080.00515.54
7.1.20.0040.00415.52
7.1.10.0020.01215.47
7.1.00.0020.03017.56
7.0.330.0040.01315.11
7.0.320.0050.00915.18
7.0.310.0080.00515.16
7.0.300.0030.00615.16
7.0.290.0060.00915.25
7.0.280.0100.00115.18
7.0.270.0040.00715.27
7.0.260.0110.00315.22
7.0.250.0070.00515.25
7.0.240.0030.00815.43
7.0.230.0010.01115.17
7.0.220.0050.00915.36
7.0.210.0100.00215.25
7.0.200.0010.01115.70
7.0.190.0050.00515.13
7.0.180.0080.00615.28
7.0.170.0050.01015.31
7.0.160.0060.00715.16
7.0.150.0030.00915.29
7.0.140.0100.00515.37
7.0.130.0070.00515.12
7.0.120.0090.00415.28
7.0.110.0030.00915.31
7.0.100.0090.00515.03
7.0.90.0220.03216.86
7.0.80.0150.03316.85
7.0.70.0160.02016.92
7.0.60.0180.02216.99
7.0.50.0200.02017.15
7.0.40.0080.03315.72
7.0.30.0110.02515.75
7.0.20.0070.03315.63
7.0.10.0090.03115.61
7.0.00.0070.03115.62
5.6.400.0070.00514.28
5.6.390.0050.01014.14
5.6.380.0020.01214.30
5.6.370.0050.00814.44
5.6.360.0040.01014.21
5.6.350.0090.00514.10
5.6.340.0060.00914.47
5.6.330.0060.00813.88
5.6.320.0030.01014.13
5.6.310.0070.00514.14
5.6.300.0050.00814.09
5.6.290.0050.00614.23
5.6.280.0060.02316.48
5.6.270.0000.01014.23
5.6.260.0080.00614.13
5.6.250.0070.00914.40
5.6.240.0030.01014.27
5.6.230.0070.01816.29
5.6.220.0030.02316.24
5.6.210.0060.02716.20
5.6.200.0100.02716.43
5.6.190.0080.03116.49
5.6.180.0060.01916.51
5.6.170.0030.02616.47
5.6.160.0050.03316.52
5.6.150.0080.02916.57
5.6.140.0050.03116.39
5.6.130.0090.03016.49
5.6.120.0020.02516.56
5.6.110.0050.03016.49
5.6.100.0040.02116.40
5.6.90.0080.02316.40
5.6.80.0040.03116.25
5.6.70.0070.02016.08
5.6.60.0040.03216.26
5.6.50.0080.02316.10
5.6.40.0010.02916.07
5.6.30.0080.02816.30
5.6.20.0100.01316.18
5.6.10.0080.02916.25
5.6.00.0050.03016.21
5.5.380.0040.00614.29
5.5.370.0080.01516.07
5.5.360.0070.02316.03
5.5.350.0020.02116.22
5.5.340.0040.03116.22
5.5.330.0070.01916.29
5.5.320.0070.02216.28
5.5.310.0050.02216.21
5.5.300.0090.02116.20
5.5.290.0040.03516.38
5.5.280.0080.02716.32
5.5.270.0060.02016.26
5.5.260.0060.03316.16
5.5.250.0070.02616.23
5.5.240.0030.02316.13
5.5.230.0060.02616.13
5.5.220.0060.03316.02
5.5.210.0070.02816.01
5.5.200.0070.02915.92
5.5.190.0070.02816.03
5.5.180.0040.02216.23
5.5.170.0080.00514.03
5.5.160.0040.03316.08
5.5.150.0070.02916.07
5.5.140.0050.01916.01
5.5.130.0060.03316.03
5.5.120.0060.02515.99
5.5.110.0050.02816.19
5.5.100.0040.03315.88
5.5.90.0050.03015.91
5.5.80.0090.03016.09
5.5.70.0100.03116.01
5.5.60.0070.02015.94
5.5.50.0040.03015.88
5.5.40.0020.03116.13
5.5.30.0050.03115.97
5.5.20.0060.02216.01
5.5.10.0070.03116.06
5.5.00.0060.02316.02

preferences:
55.01 ms | 401 KiB | 5 Q