3v4l.org

run code in 300+ PHP versions simultaneously
<?php class salutations { public function hello() { return "Hello World!"; } } class methodFactory { public function __construct($instance) { $this->package = $instance; } public function getPackageMethod($method) { if (method_exists($this->package, $method)) { $f = function() use ($method) { return $this->$method(); }; $f->bindTo($this->package); return $f; } } } $salutationsInstance = new salutations(); $obj = new methodFactory($salutationsInstance); $hello = $obj->getPackageMethod('hello'); echo $hello();

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.0160.00616.63
8.3.50.0090.00916.37
8.3.40.0040.01118.79
8.3.30.0040.01218.97
8.3.20.0070.00020.20
8.3.10.0060.00323.53
8.3.00.0080.00017.93
8.2.180.0200.01016.75
8.2.170.0140.00322.96
8.2.160.0110.00420.39
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00317.63
8.2.110.0000.01122.25
8.2.100.0060.00617.93
8.2.90.0040.00419.09
8.2.80.0090.00017.97
8.2.70.0060.00317.61
8.2.60.0050.00517.80
8.2.50.0050.00318.07
8.2.40.0040.00421.07
8.2.30.0040.00420.64
8.2.20.0040.00417.86
8.2.10.0030.00518.07
8.2.00.0050.00218.05
8.1.280.0100.01025.92
8.1.270.0080.00023.79
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.59
8.1.230.0060.00617.42
8.1.220.0050.00217.79
8.1.210.0030.00618.77
8.1.200.0040.00417.25
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0030.00620.50
8.1.160.0040.00422.07
8.1.150.0040.00418.85
8.1.140.0030.00519.52
8.1.130.0000.00817.52
8.1.120.0000.00817.54
8.1.110.0070.00017.46
8.1.100.0000.00917.51
8.1.90.0040.00417.46
8.1.80.0040.00417.46
8.1.70.0000.00717.38
8.1.60.0090.00017.48
8.1.50.0000.00817.55
8.1.40.0040.00417.51
8.1.30.0000.00817.50
8.1.20.0040.00417.64
8.1.10.0000.00717.65
8.1.00.0040.00417.51
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0080.00018.37
8.0.270.0000.00817.11
8.0.260.0070.00016.89
8.0.250.0040.00416.92
8.0.240.0080.00017.00
8.0.230.0040.00417.02
8.0.220.0040.00416.96
8.0.210.0040.00416.97
8.0.200.0000.00717.03
8.0.190.0000.00916.93
8.0.180.0070.00017.01
8.0.170.0000.00816.99
8.0.160.0000.00716.86
8.0.150.0040.00416.98
8.0.140.0000.00716.90
8.0.130.0050.00013.39
8.0.120.0030.00516.81
8.0.110.0040.00416.99
8.0.100.0000.00816.77
8.0.90.0050.00216.87
8.0.80.0100.00916.87
8.0.70.0000.00716.84
8.0.60.0000.00716.96
8.0.50.0040.00416.83
8.0.30.0160.00117.23
8.0.20.0100.00817.40
8.0.10.0000.00816.92
8.0.00.0060.01216.80
7.4.330.0000.00615.12
7.4.320.0060.00016.57
7.4.300.0060.00316.50
7.4.290.0000.00716.52
7.4.280.0100.00016.51
7.4.270.0000.00716.38
7.4.260.0000.00716.50
7.4.250.0040.00416.47
7.4.240.0020.00516.56
7.4.230.0000.00716.70
7.4.220.0030.01516.63
7.4.210.0100.01016.64
7.4.200.0040.00416.61
7.4.160.0040.01216.43
7.4.150.0140.01117.40
7.4.140.0080.01317.86
7.4.130.0150.00616.45
7.4.120.0160.00616.47
7.4.110.0140.00316.55
7.4.100.0030.02016.46
7.4.90.0140.00316.63
7.4.80.0100.00719.39
7.4.70.0130.01016.44
7.4.60.0120.00416.59
7.4.50.0030.00516.52
7.4.40.0150.00316.46
7.4.30.0090.00916.36
7.4.00.0060.00715.11
7.3.330.0000.00613.34
7.3.320.0050.00013.31
7.3.310.0000.00616.41
7.3.300.0000.00716.39
7.3.290.0050.01216.36
7.3.280.0050.01116.37
7.3.270.0070.01117.40
7.3.260.0130.01016.67
7.3.240.0110.01116.63
7.3.230.0140.00316.56
7.3.210.0070.01016.54
7.3.200.0120.00616.45
7.3.190.0100.00716.55
7.3.180.0070.01416.57
7.3.170.0110.01016.45
7.3.160.0040.01116.38
7.3.120.0070.01314.64
7.3.110.0090.00914.94
7.3.100.0060.00914.86
7.3.90.0030.01014.67
7.3.80.0100.00714.92
7.3.70.0060.00614.68
7.3.60.0060.00814.88
7.3.50.0090.00014.92
7.3.40.0130.00314.44
7.3.30.0060.00914.82
7.3.20.0090.00916.82
7.3.10.0030.00916.42
7.3.00.0040.01116.44
7.2.330.0150.00316.35
7.2.320.0000.01716.47
7.2.310.0060.00916.59
7.2.300.0030.01416.83
7.2.290.0120.00616.41
7.2.250.0030.01214.98
7.2.240.0100.01015.13
7.2.230.0070.00715.16
7.2.220.0040.01115.21
7.2.210.0030.00715.19
7.2.200.0130.00015.17
7.2.190.0070.00714.68
7.2.180.0000.01315.07
7.2.170.0060.00915.08
7.2.60.0120.00316.75
7.2.00.0060.00619.55
7.1.330.0120.00315.82
7.1.320.0070.00715.76
7.1.310.0000.01215.95
7.1.300.0110.00015.73
7.1.290.0030.01215.80
7.1.280.0060.00615.81
7.1.270.0060.00915.47
7.1.260.0040.00715.82
7.1.200.0260.00615.49
7.1.100.0000.01418.09
7.1.70.0060.00617.25
7.1.60.0070.01719.50
7.1.50.0130.00717.03
7.1.00.0070.07322.40
7.0.200.0030.00616.68
7.0.60.0070.08319.93
7.0.50.0030.04017.82
7.0.40.0100.08020.04
7.0.30.0230.06020.26
7.0.20.0170.04320.30
7.0.10.0030.08720.09
7.0.00.0030.04320.29
5.6.280.0070.03720.83
5.6.210.0130.06320.62
5.6.200.0100.03318.16
5.6.190.0030.04720.47
5.6.180.0330.05720.46
5.6.170.0270.08320.48
5.6.160.0000.09020.57
5.6.150.0130.07718.23
5.6.140.0030.08318.29
5.6.130.0030.06018.23
5.6.120.0030.04721.11
5.6.110.0070.05021.00
5.6.100.0030.04021.00
5.6.90.0130.08020.98
5.6.80.0200.05320.49
5.5.350.0170.06720.33
5.5.340.0130.04018.08
5.5.330.0030.04020.23
5.5.320.3870.04720.32
5.5.310.0270.07020.26
5.5.300.0070.05717.99
5.5.290.0030.05317.91
5.5.280.0100.05320.81
5.5.270.0030.07720.76
5.5.260.0100.03320.77
5.5.250.0130.08020.70
5.5.240.0000.07720.29
5.4.450.0570.06319.59
5.4.440.0600.06019.60
5.4.430.0670.06719.40
5.4.420.0700.05019.59
5.4.410.0630.05319.56
5.4.400.0700.04719.37
5.4.390.0630.05318.91
5.4.380.0600.05719.24
5.4.370.0630.05318.96
5.4.360.0570.06019.20
5.4.350.0600.05718.80
5.4.340.0570.06018.96
5.4.320.0600.06019.07
5.4.310.0570.06018.79
5.4.300.0770.04719.05
5.4.290.0670.05718.80
5.4.280.0700.05319.24
5.4.270.0700.05319.09
5.4.260.0630.06719.08
5.4.250.0830.05318.73
5.4.240.0700.05018.96
5.4.230.0670.06019.25
5.4.220.0670.05718.77
5.4.210.0770.04319.21
5.4.200.0670.05319.25
5.4.190.0730.05719.07
5.4.180.0670.05019.07
5.4.170.0770.04319.16
5.4.160.0730.04719.26
5.4.150.0700.05319.16
5.4.140.0670.05016.56
5.4.130.0800.03716.36
5.4.120.0800.05716.55
5.4.110.0670.05316.62
5.4.100.0600.05716.63
5.4.90.0670.05016.42
5.4.80.0670.05016.59
5.4.70.0670.05316.64
5.4.60.0630.05316.46
5.4.50.0600.05716.53
5.4.40.0770.06716.36
5.4.30.0630.05016.55
5.4.20.0730.04716.52
5.4.10.0730.04716.52
5.4.00.0730.04715.78

preferences:
52.82 ms | 400 KiB | 5 Q