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); 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.00716.75
8.3.50.0100.00721.06
8.3.40.0170.00318.82
8.3.30.0120.00318.84
8.3.20.0000.00720.21
8.3.10.0040.00423.72
8.3.00.0040.00418.03
8.2.180.0070.01118.43
8.2.170.0070.00722.96
8.2.160.0030.01020.36
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00017.75
8.2.110.0070.00321.13
8.2.100.0040.00718.04
8.2.90.0040.00419.23
8.2.80.0050.00317.97
8.2.70.0050.00317.75
8.2.60.0090.00317.80
8.2.50.0050.00318.07
8.2.40.0050.00321.01
8.2.30.0020.00520.51
8.2.20.0080.00017.86
8.2.10.0060.00318.00
8.2.00.0000.00817.99
8.1.280.0070.01425.92
8.1.270.0040.00424.02
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00621.16
8.1.230.0080.00417.42
8.1.220.0080.00017.74
8.1.210.0090.00018.77
8.1.200.0030.00617.47
8.1.190.0040.00417.13
8.1.180.0000.00818.10
8.1.170.0040.00420.38
8.1.160.0040.00421.93
8.1.150.0030.00518.94
8.1.140.0000.00819.50
8.1.130.0030.00317.63
8.1.120.0030.00317.34
8.1.110.0020.00517.44
8.1.100.0040.00417.36
8.1.90.0000.00717.47
8.1.80.0000.00717.36
8.1.70.0030.00317.36
8.1.60.0090.00017.53
8.1.50.0070.00017.59
8.1.40.0070.00317.49
8.1.30.0040.00417.71
8.1.20.0030.00517.70
8.1.10.0040.00417.44
8.1.00.0040.00417.53
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0000.00718.50
8.0.270.0000.00917.26
8.0.260.0030.00317.31
8.0.250.0040.00416.91
8.0.240.0080.00017.04
8.0.230.0030.00316.95
8.0.220.0030.00316.99
8.0.210.0070.00016.94
8.0.200.0030.00317.03
8.0.190.0000.00817.04
8.0.180.0000.00716.93
8.0.170.0080.00017.01
8.0.160.0000.00716.95
8.0.150.0070.00016.94
8.0.140.0040.00416.93
8.0.130.0030.00313.38
8.0.120.0040.00416.98
8.0.110.0020.00516.89
8.0.100.0000.00816.77
8.0.90.0000.00716.99
8.0.80.0090.00616.92
8.0.70.0040.00416.88
8.0.60.0040.00416.73
8.0.50.0000.00716.91
8.0.30.0080.00816.89
8.0.20.0120.00717.40
8.0.10.0070.00016.91
8.0.00.0100.00816.93
7.4.330.0020.00215.08
7.4.320.0070.00016.57
7.4.300.0080.00016.56
7.4.290.0080.00016.48
7.4.280.0030.00716.51
7.4.270.0000.00716.50
7.4.260.0000.00716.57
7.4.250.0040.00416.59
7.4.240.0040.00416.53
7.4.230.0000.00716.58
7.4.220.0070.01416.53
7.4.210.0130.00716.59
7.4.200.0040.00416.34
7.4.160.0100.00616.72
7.4.150.0170.00317.40
7.4.140.0130.01017.86
7.4.130.0070.01116.77
7.4.120.0090.00916.66
7.4.110.0110.00716.43
7.4.100.0030.01316.61
7.4.90.0060.01016.61
7.4.80.0140.00819.39
7.4.70.0070.01116.42
7.4.60.0160.00016.46
7.4.50.0000.00816.65
7.4.40.0130.00316.61
7.4.30.0170.00016.48
7.4.00.0060.00914.84
7.3.330.0000.00613.32
7.3.320.0050.00013.33
7.3.310.0000.00716.38
7.3.300.0000.00716.41
7.3.290.0110.00716.36
7.3.280.0100.01016.32
7.3.270.0140.00517.40
7.3.260.0090.00916.50
7.3.240.0060.01316.34
7.3.230.0130.00416.53
7.3.210.0070.01016.54
7.3.200.0100.00616.50
7.3.190.0130.00316.56
7.3.180.0100.00716.50
7.3.170.0090.01216.32
7.3.160.0040.01116.50
7.3.120.0060.00914.60
7.3.110.0140.00014.72
7.3.100.0030.01014.93
7.3.90.0070.00414.97
7.3.80.0040.01114.71
7.3.70.0070.00714.83
7.3.60.0030.01014.70
7.3.50.0040.00814.87
7.3.40.0040.00714.63
7.3.30.0050.00514.86
7.3.20.0060.00616.77
7.3.10.0070.00716.46
7.3.00.0060.00716.68
7.2.330.0130.00716.66
7.2.320.0090.00916.71
7.2.310.0080.00816.72
7.2.300.0130.00316.41
7.2.290.0060.01216.43
7.2.240.0000.00814.93
7.2.230.0030.01414.98
7.2.220.0040.00815.00
7.2.210.0030.00914.91
7.2.200.0030.00615.20
7.2.190.0060.00915.08
7.2.180.0100.00715.02
7.2.170.0090.00314.86
7.2.160.0030.00714.89
7.2.150.0060.01016.85
7.2.140.0030.01316.86
7.2.130.0070.00916.93
7.2.120.0080.01016.90
7.2.110.0100.00516.89
7.2.100.0040.00916.79
7.2.90.0050.00716.96
7.2.80.0030.01516.91
7.2.70.0100.00316.97
7.2.60.0030.01116.87
7.2.50.0060.00816.81
7.2.40.0120.00217.03
7.2.30.0070.00716.91
7.2.20.0050.01016.83
7.2.10.0030.01016.85
7.2.00.0050.01017.72
7.1.330.0030.01015.61
7.1.320.0030.01315.81
7.1.310.0040.00415.78
7.1.300.0100.00615.81
7.1.290.0040.01115.56
7.1.280.0030.01015.59
7.1.270.0030.01016.05
7.1.260.0060.00615.91
7.1.250.0030.01215.72
7.1.200.0030.01015.79
7.1.100.0050.00818.36
7.1.70.0100.00317.02
7.1.60.0100.01419.50
7.1.50.0160.00316.95
7.1.00.0100.06722.27
7.0.200.0030.00516.80
7.0.60.0030.04019.78
7.0.50.0070.07017.88
7.0.40.0100.07320.24
7.0.30.0200.07020.08
7.0.20.0170.04020.16
7.0.10.0030.04720.23
7.0.00.0200.06320.05
5.6.280.0030.03721.14
5.6.210.0170.07020.70
5.6.200.0070.08018.16
5.6.190.0030.08320.61
5.6.180.0430.07020.60
5.6.170.0270.05020.39
5.6.160.0100.08020.57
5.6.150.0070.07718.21
5.6.140.0030.04718.29
5.6.130.0070.05318.27
5.6.120.0100.03321.11
5.6.110.0170.07721.02
5.6.100.0100.07021.12
5.6.90.0030.04321.13
5.6.80.0130.07720.39
5.5.350.0030.08320.39
5.5.340.0030.07017.96
5.5.330.0100.04320.47
5.5.320.4000.03720.29
5.5.310.0230.04720.19
5.5.300.0100.04317.94
5.5.290.0100.05718.07
5.5.280.0030.04020.99
5.5.270.0070.04720.74
5.5.260.0100.08720.98
5.5.250.0130.05020.67
5.5.240.0100.05020.25
5.4.450.0800.05319.41
5.4.440.0730.06319.34
5.4.430.0670.05719.59
5.4.420.0900.05319.12
5.4.410.0670.05719.00
5.4.400.0670.05019.08
5.4.390.0700.05319.02
5.4.380.0630.05719.23
5.4.370.0770.04019.07
5.4.360.0670.05019.08
5.4.350.0770.06019.27
5.4.340.0630.06719.07
5.4.320.0630.06019.20
5.4.310.0630.05318.78
5.4.300.0700.05018.78
5.4.290.0570.06019.05
5.4.280.0700.05019.24
5.4.270.0700.05019.08
5.4.260.0600.05719.07
5.4.250.0700.04719.24
5.4.240.0730.05018.77
5.4.230.0730.05719.06
5.4.220.0730.04718.90
5.4.210.0900.05319.02
5.4.200.0670.05719.23
5.4.190.0730.05019.35
5.4.180.0730.05019.07
5.4.170.0830.06019.01
5.4.160.0600.05719.04
5.4.150.0670.05019.05
5.4.140.0830.06016.46
5.4.130.0630.05316.56
5.4.120.0870.05316.32
5.4.110.0670.05316.27
5.4.100.0670.05016.67
5.4.90.0700.04716.43
5.4.80.0730.04716.58
5.4.70.0670.05016.64
5.4.60.0730.04716.46
5.4.50.0770.04716.57
5.4.40.0700.05016.47
5.4.30.0700.06316.46
5.4.20.0630.05716.46
5.4.10.0730.05016.22
5.4.00.0700.04715.84

preferences:
57.79 ms | 401 KiB | 5 Q