3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { var_dump(__METHOD__); } public function baz() { var_dump(__METHOD__); } public function bat() { var_dump(__METHOD__); return 'bat!'; } } class FluentWrapper { private $instance; private $fluentMethods; public function __construct($instance, array $fluentMethods = []) { $this->instance = $instance; $this->fluentMethods = $fluentMethods; } public function __call($name, $args) { $result = call_user_func([$this->instance, $name], $args); return in_array($name, $this->fluentMethods) ? $this : $result; } } class FluentFoo extends FluentWrapper { public function __construct(Foo $foo) { parent::__construct($foo, ['bar', 'baz']); } } $foo = new FluentFoo(new Foo()); $bat = $foo ->bar() ->baz() ->bar() ->baz() ->bat(); print $bat."\n";

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.40.0070.00718.67
8.3.30.0070.01119.04
8.3.20.0040.00420.05
8.3.10.0080.00023.40
8.3.00.0040.00420.88
8.2.170.0070.00722.96
8.2.160.0100.00320.52
8.2.150.0000.00724.18
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0070.00022.16
8.2.110.0090.00022.12
8.2.100.0040.00818.03
8.2.90.0050.00319.36
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0030.00517.93
8.2.50.0000.00818.07
8.2.40.0000.00819.88
8.2.30.0030.00518.23
8.2.20.0000.00817.69
8.2.10.0040.00418.14
8.2.00.0040.00417.71
8.1.270.0040.00422.07
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00622.05
8.1.230.0070.00419.00
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0000.00917.35
8.1.190.0080.00017.35
8.1.180.0000.00819.01
8.1.170.0050.00318.61
8.1.160.0040.00422.05
8.1.150.0070.00018.66
8.1.140.0040.00417.39
8.1.130.0000.00717.72
8.1.120.0080.00017.48
8.1.110.0030.00717.34
8.1.100.0040.00417.46
8.1.90.0040.00417.49
8.1.80.0000.00717.42
8.1.70.0030.00317.45
8.1.60.0080.00017.54
8.1.50.0040.00417.48
8.1.40.0040.00417.57
8.1.30.0000.00817.57
8.1.20.0000.00717.66
8.1.10.0000.00817.62
8.1.00.0030.00617.55
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0030.00318.46
8.0.270.0000.00717.28
8.0.260.0000.00617.28
8.0.250.0070.00017.08
8.0.240.0000.00716.96
8.0.230.0000.00717.01
8.0.220.0030.00316.99
8.0.210.0040.00416.93
8.0.200.0030.00317.10
8.0.190.0040.00417.01
8.0.180.0000.00816.99
8.0.170.0040.00416.96
8.0.160.0000.00716.94
8.0.150.0070.00016.88
8.0.140.0070.00316.96
8.0.130.0000.00613.40
8.0.120.0030.00616.94
8.0.110.0050.00216.86
8.0.100.0030.00516.94
8.0.90.0070.00017.01
8.0.80.0120.00917.03
8.0.70.0000.00816.85
8.0.60.0000.00716.88
8.0.50.0040.00416.95
8.0.30.0100.01017.33
8.0.20.0130.00517.40
8.0.10.0040.00417.12
8.0.00.0120.01216.64
7.4.330.0050.00015.05
7.4.320.0000.00616.43
7.4.300.0030.00516.51
7.4.290.0030.00316.63
7.4.280.0040.00416.61
7.4.270.0000.00716.52
7.4.260.0030.00316.59
7.4.250.0040.00416.43
7.4.240.0040.00416.56
7.4.230.0000.00816.63
7.4.220.0080.01116.61
7.4.210.0070.00916.58
7.4.200.0000.00716.54
7.4.190.0070.00016.38
7.4.160.0040.01116.66
7.4.150.0150.00317.40
7.4.140.0060.01117.86
7.4.130.0120.00516.49
7.4.120.0070.01316.51
7.4.110.0090.00916.52
7.4.100.0110.00716.48
7.4.90.0130.00316.54
7.4.80.0160.00319.39
7.4.70.0120.01216.65
7.4.60.0000.01716.30
7.4.50.0000.00716.59
7.4.40.0140.00716.50
7.4.30.0110.00616.26
7.4.00.0090.00814.96
7.3.330.0000.00513.31
7.3.320.0050.00013.26
7.3.310.0030.00616.16
7.3.300.0000.00716.29
7.3.290.0100.00516.24
7.3.280.0060.01016.34
7.3.270.0110.00617.40
7.3.260.0090.00816.50
7.3.250.0110.00616.46
7.3.240.0080.00816.63
7.3.230.0070.01016.39
7.3.210.0090.00816.32
7.3.200.0070.01019.39
7.3.190.0140.00816.25
7.3.180.0150.00316.57
7.3.170.0110.01116.48
7.3.160.0070.01016.30
7.3.120.0100.00714.69
7.3.110.0100.00314.88
7.3.100.0030.01014.43
7.3.90.0040.01115.03
7.3.80.0040.00814.95
7.3.70.0000.01414.76
7.3.60.0000.01314.74
7.3.50.0090.00614.69
7.3.40.0100.00314.54
7.3.30.0040.01114.80
7.3.20.0060.00616.82
7.3.10.0040.01216.64
7.3.00.0100.00716.54
7.2.330.0090.00916.51
7.2.320.0100.01416.85
7.2.310.0160.00316.54
7.2.300.0070.01016.45
7.2.290.0040.01816.52
7.2.250.0000.02115.30
7.2.240.0060.01215.00
7.2.230.0090.00615.20
7.2.220.0030.01215.35
7.2.210.0080.00414.97
7.2.200.0060.00914.64
7.2.190.0040.01015.20
7.2.180.0030.01014.69
7.2.170.0100.00014.89
7.2.60.0030.00916.89
7.1.330.0000.01515.73
7.1.320.0060.00615.91
7.1.310.0090.00615.76
7.1.300.0070.00315.58
7.1.290.0070.00415.68
7.1.280.0040.01115.52
7.1.270.0000.01415.83
7.1.260.0070.01015.86
7.1.200.0100.00315.62
7.1.70.0080.00516.87
7.1.60.0160.00919.46
7.1.50.0100.01017.00
7.1.00.0100.07022.28
7.0.200.0050.00216.73
7.0.140.0100.06722.21
7.0.60.0030.05721.70
7.0.50.0070.07017.99
7.0.40.0070.04720.28
7.0.30.0270.09720.09
7.0.20.0300.05020.16
7.0.10.0030.04320.24
7.0.00.0030.08320.22
5.6.280.0000.07721.08
5.6.210.0100.07720.46
5.6.200.0030.05718.20
5.6.190.0130.08020.61
5.6.180.0170.06720.67
5.6.170.0330.07320.53
5.6.160.0070.06020.57
5.6.150.0130.06318.29
5.6.140.0130.03018.24
5.6.130.0070.06718.17
5.6.120.0100.07321.00
5.6.110.0100.03720.99
5.6.100.0130.07720.99
5.6.90.0230.06720.96
5.6.80.0070.03720.51
5.5.350.0170.07720.40
5.5.340.0070.07318.09
5.5.330.0030.06720.15
5.5.320.0230.05020.36
5.5.310.0470.04020.23
5.5.300.0030.07318.05
5.5.290.0030.07717.98
5.5.280.0070.04020.98
5.5.270.0130.07320.88
5.5.260.0130.07720.88
5.5.250.0200.06720.70
5.5.240.0300.07020.09
5.4.450.1530.03719.39
5.4.440.1630.04319.57
5.4.430.1030.04719.27
5.4.420.0000.04019.47
5.4.410.0070.03319.39
5.4.400.1530.04719.29
5.4.390.1500.04019.18
5.4.380.1730.05019.00
5.4.370.1470.04019.07
5.4.360.1630.04318.95
5.4.350.1870.04018.95
5.4.340.1630.04718.88
5.4.320.1670.05019.16
5.4.310.1730.04019.06
5.4.300.1670.04719.13
5.4.290.1700.04718.84
5.4.280.0700.04318.86
5.4.270.0100.03719.13
5.4.260.0170.04319.15
5.4.250.1770.04718.96
5.4.240.1630.03319.19
5.4.230.1770.04319.25
5.4.220.1500.03719.14
5.4.210.1530.03319.16
5.4.200.1830.04718.99
5.4.190.1770.04319.05
5.4.180.1800.04718.94
5.4.170.1800.04719.08
5.4.160.1830.04318.82
5.4.150.1870.04319.06
5.4.140.0570.04716.73
5.4.130.0030.06316.50
5.4.120.0330.03016.54
5.4.110.1730.04316.35
5.4.100.2170.03716.45
5.4.90.1570.03316.50
5.4.80.1570.03316.55
5.4.70.1800.04716.23
5.4.60.1630.03316.40
5.4.50.1500.03316.52
5.4.40.1670.04016.52
5.4.30.1600.03316.42
5.4.20.1470.03316.48
5.4.10.0870.03316.30
5.4.00.0000.03715.96
5.3.290.0070.03314.79
5.3.280.0130.03714.61
5.3.270.1600.03714.75
5.3.260.1600.03714.75
5.3.250.1530.03314.70
5.3.240.1430.04014.68
5.3.230.1430.03714.61
5.3.220.1300.03314.54
5.3.210.1400.04014.62
5.3.200.1630.03014.68
5.3.190.1570.04014.60
5.3.180.1370.04014.71
5.3.170.1500.03014.55
5.3.160.1200.05014.46
5.3.150.0100.04014.62
5.3.140.0030.03714.64
5.3.130.0830.03314.59
5.3.120.1600.04714.49
5.3.110.1530.03014.63
5.3.100.1470.03714.09
5.3.90.1630.04314.01
5.3.80.1530.03013.93
5.3.70.1370.03013.95
5.3.60.1330.03714.12
5.3.50.1300.03314.12
5.3.40.1500.03714.07
5.3.30.1700.03313.96
5.3.20.1470.04313.63
5.3.10.1070.04013.59
5.3.00.0000.05013.87
5.2.170.0000.03711.07
5.2.160.0500.06011.38
5.2.150.1370.03711.08
5.2.140.0930.04711.21
5.2.130.0030.03311.02
5.2.120.0030.02711.12
5.2.110.0430.03011.11
5.2.100.1500.03311.33
5.2.90.1300.02711.25
5.2.80.1500.03311.02
5.2.70.1300.02711.11
5.2.60.1230.03011.03
5.2.50.1370.04010.95
5.2.40.1200.04011.00
5.2.30.1100.03311.22
5.2.20.1000.03310.97
5.2.10.1070.03310.82
5.2.00.0030.02710.69
5.1.60.0030.05010.15
5.1.50.0030.03710.08
5.1.40.0100.0279.97
5.1.30.1000.02710.25
5.1.20.1070.02010.34
5.1.10.1130.0209.96
5.1.00.1000.0339.96
5.0.50.0600.0238.50
5.0.40.0500.0178.54
5.0.30.0500.0308.36
5.0.20.0500.0178.29
5.0.10.0500.0238.08
5.0.00.0570.0338.04
4.4.90.0600.0137.94
4.4.80.0500.0177.94
4.4.70.0530.0137.94
4.4.60.0630.0277.94
4.4.50.0530.0207.94
4.4.40.0530.0237.94
4.4.30.0630.0177.94
4.4.20.0570.0237.94
4.4.10.0530.0137.94
4.4.00.0530.0407.94
4.3.110.0000.0177.94
4.3.100.0000.0277.94
4.3.90.0070.0137.94
4.3.80.0000.0237.94
4.3.70.0000.0207.94
4.3.60.0030.0307.94
4.3.50.0000.0207.94
4.3.40.0130.0307.94
4.3.30.0130.0177.94
4.3.20.0230.0137.94
4.3.10.0230.0207.94
4.3.00.0230.0137.94

preferences:
34.35 ms | 400 KiB | 5 Q