3v4l.org

run code in 300+ PHP versions simultaneously
<?php // explicit mention of methods that should be fluent // would be preferable to returning $this on null // since a method may very well return null as something // that is expected. 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 = array()) { $this->instance = $instance; $this->fluentMethods = $fluentMethods; } public function __call($name, $args) { $result = call_user_func(array($this->instance, $name), $args); return in_array($name, $this->fluentMethods) ? $this : $result; } } class FluentFoo extends FluentWrapper { public function __construct(Foo $foo) { parent::__construct($foo, array('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.60.0030.01016.63
8.3.50.0150.00622.09
8.3.40.0120.00319.01
8.3.30.0000.01419.04
8.3.20.0080.00020.20
8.3.10.0040.00423.66
8.3.00.0040.00419.19
8.2.180.0040.01218.17
8.2.170.0070.00722.96
8.2.160.0070.00720.36
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.26
8.2.110.0090.00019.39
8.2.100.0120.00017.91
8.2.90.0040.00419.09
8.2.80.0080.00017.97
8.2.70.0000.01017.63
8.2.60.0060.00317.80
8.2.50.0000.00818.10
8.2.40.0060.00319.88
8.2.30.0030.00518.16
8.2.20.0080.00017.60
8.2.10.0050.00317.98
8.2.00.0080.00017.70
8.1.280.0140.00425.92
8.1.270.0060.01022.12
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0070.00423.91
8.1.230.0120.00022.64
8.1.220.0080.00017.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0080.00018.42
8.1.160.0070.00021.93
8.1.150.0040.00418.68
8.1.140.0040.00417.50
8.1.130.0040.00417.91
8.1.120.0040.00417.51
8.1.110.0030.00817.50
8.1.100.0040.00417.37
8.1.90.0040.00417.43
8.1.80.0000.00817.43
8.1.70.0030.00317.45
8.1.60.0050.00317.49
8.1.50.0060.00317.47
8.1.40.0000.00717.51
8.1.30.0000.00817.66
8.1.20.0040.00417.69
8.1.10.0040.00417.45
8.1.00.0030.00517.59
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0050.00218.34
8.0.270.0050.00216.86
8.0.260.0000.00617.30
8.0.250.0040.00416.97
8.0.240.0000.00817.03
8.0.230.0030.00516.86
8.0.220.0030.00316.93
8.0.210.0070.00016.99
8.0.200.0000.00617.00
8.0.190.0040.00417.00
8.0.180.0070.00016.92
8.0.170.0040.00417.02
8.0.160.0040.00416.86
8.0.150.0040.00416.84
8.0.140.0060.00316.82
8.0.130.0000.00613.34
8.0.120.0000.00816.92
8.0.110.0040.00416.80
8.0.100.0040.00417.07
8.0.90.0060.00316.83
8.0.80.0090.01617.01
8.0.70.0030.00516.86
8.0.60.0000.00716.84
8.0.50.0040.00416.83
8.0.30.0140.00617.26
8.0.20.0080.01017.40
8.0.10.0050.00317.06
8.0.00.0080.01016.80
7.4.330.0000.00515.08
7.4.320.0040.00416.41
7.4.300.0030.00516.60
7.4.290.0070.00016.64
7.4.280.0000.00716.52
7.4.270.0000.00716.54
7.4.260.0030.00316.50
7.4.250.0050.00516.63
7.4.240.0000.00716.44
7.4.230.0000.00716.64
7.4.220.0090.00916.55
7.4.210.0070.00816.56
7.4.200.0020.00516.50
7.4.190.0020.00516.39
7.4.160.0030.01316.64
7.4.150.0030.01317.40
7.4.140.0050.01217.86
7.4.130.0090.01116.55
7.4.120.0050.01116.50
7.4.110.0090.01516.37
7.4.100.0110.00716.50
7.4.90.0100.01016.52
7.4.80.0130.00619.39
7.4.70.0040.01416.61
7.4.60.0170.00016.35
7.4.50.0030.00616.35
7.4.40.0180.00716.52
7.4.30.0110.01116.52
7.4.10.0120.00314.72
7.4.00.0090.00715.03
7.3.330.0000.00613.32
7.3.320.0000.00513.26
7.3.310.0000.00816.30
7.3.300.0000.00716.33
7.3.290.0140.00616.36
7.3.280.0110.00816.28
7.3.270.0100.00717.40
7.3.260.0030.01516.51
7.3.250.0140.00316.46
7.3.240.0120.00616.48
7.3.230.0110.00616.54
7.3.210.0140.00316.45
7.3.200.0070.01019.39
7.3.190.0070.01416.25
7.3.180.0040.01316.18
7.3.170.0060.01016.39
7.3.160.0090.01116.41
7.3.130.0100.01014.99
7.3.120.0040.01114.71
7.3.110.0100.00714.94
7.3.100.0050.01214.74
7.3.90.0100.00714.87
7.3.80.0060.00914.85
7.3.70.0020.00914.72
7.3.60.0030.01114.70
7.3.50.0020.01014.69
7.3.40.0030.01014.87
7.3.30.0080.00414.85
7.3.20.0100.00416.73
7.3.10.0050.00816.34
7.3.00.0060.00716.58
7.2.330.0090.00916.75
7.2.320.0130.01016.80
7.2.310.0180.00616.36
7.2.300.0080.00916.84
7.2.290.0040.01216.62
7.2.260.0000.01714.67
7.2.250.0090.00915.07
7.2.240.0070.00915.16
7.2.230.0060.01115.16
7.2.220.0070.00714.88
7.2.210.0080.00714.87
7.2.200.0030.00814.94
7.2.190.0060.00815.04
7.2.180.0040.01015.14
7.2.170.0080.00515.10
7.2.160.0040.01115.02
7.2.150.0070.00716.73
7.2.140.0030.00616.75
7.2.130.0040.01016.82
7.2.120.0030.00917.00
7.2.110.0090.00616.95
7.2.100.0040.01117.08
7.2.90.0030.00916.73
7.2.80.0030.01016.96
7.2.70.0040.00716.95
7.2.60.0060.01216.70
7.2.50.0100.00016.81
7.2.40.0000.01617.19
7.2.30.0040.01117.02
7.2.20.0040.01117.20
7.2.10.0060.00616.87
7.2.00.0030.00817.01
7.1.330.0050.00815.78
7.1.320.0060.00715.64
7.1.310.0060.01115.73
7.1.300.0100.00215.90
7.1.290.0040.00815.81
7.1.280.0060.00415.80
7.1.270.0040.01015.83
7.1.260.0040.00515.71
7.1.250.0040.00815.76
7.1.240.0060.00915.63
7.1.230.0000.01215.80
7.1.220.0070.00315.89
7.1.210.0040.00715.55
7.1.200.0030.00515.98
7.1.190.0000.01415.89
7.1.180.0000.01115.74
7.1.170.0070.00715.64
7.1.160.0090.00615.70
7.1.150.0000.01515.70
7.1.140.0000.00915.55
7.1.130.0030.01015.98
7.1.120.0080.00315.84
7.1.110.0090.00315.56
7.1.100.0060.00615.99
7.1.90.0040.00815.79
7.1.80.0080.00815.74
7.1.70.0020.00816.35
7.1.60.0080.01117.69
7.1.50.0030.01116.29
7.1.40.0030.01315.79
7.1.30.0140.00015.63
7.1.20.0130.00015.37
7.1.10.0000.01215.73
7.1.00.0060.03818.88
7.0.330.0050.00315.45
7.0.320.0030.00915.38
7.0.310.0030.00715.46
7.0.300.0080.00415.60
7.0.290.0070.00415.32
7.0.280.0060.00915.25
7.0.270.0000.00815.39
7.0.260.0070.00715.24
7.0.250.0000.01515.39
7.0.240.0060.00615.21
7.0.230.0030.00915.44
7.0.220.0060.01015.25
7.0.210.0030.00815.10
7.0.200.0000.01015.99
7.0.190.0060.00315.33
7.0.180.0070.00715.21
7.0.170.0000.01415.52
7.0.160.0040.00815.53
7.0.150.0030.01015.53
7.0.140.0020.04318.61
7.0.130.0000.01615.36
7.0.120.0050.00515.05
7.0.110.0070.00315.49
7.0.100.0000.01315.55
7.0.90.0030.00715.39
7.0.80.0030.01315.28
7.0.70.0080.00615.46
7.0.60.0080.03517.72
7.0.50.0080.04316.70
7.0.40.0080.03316.84
7.0.30.0180.04316.80
7.0.20.0130.02116.79
7.0.10.0060.02316.85
7.0.00.0030.05016.86
5.6.400.0080.00314.62
5.6.390.0000.00814.33
5.6.380.0000.00914.44
5.6.370.0070.00414.18
5.6.360.0060.00914.37
5.6.350.0030.01014.63
5.6.340.0110.00314.45
5.6.330.0000.01214.72
5.6.320.0060.00814.65
5.6.310.0060.00314.20
5.6.300.0090.00613.97
5.6.290.0070.00314.46
5.6.280.0050.04017.67
5.6.270.0110.00314.23
5.6.260.0070.00714.12
5.6.250.0030.00914.15
5.6.240.0070.00314.27
5.6.230.0040.01414.50
5.6.220.0060.00914.51
5.6.210.0080.03317.54
5.6.200.0070.04116.41
5.6.190.0070.02517.68
5.6.180.0210.03817.58
5.6.170.0210.03817.41
5.6.160.0030.04817.46
5.6.150.0050.03816.18
5.6.140.0100.04416.26
5.6.130.0030.04916.28
5.6.120.0070.04417.48
5.6.110.0020.05017.63
5.6.100.0030.04517.54
5.6.90.0050.05117.52
5.6.80.0080.03917.29
5.6.70.0040.01114.38
5.6.60.0070.00414.43
5.6.50.0090.00314.33
5.6.40.0060.00914.46
5.6.30.0100.00714.39
5.6.20.0000.01514.43
5.6.10.0090.00614.16
5.6.00.0090.00614.30
5.5.380.0000.01414.02
5.5.370.0040.01114.19
5.5.360.0080.00614.18
5.5.350.0200.03717.42
5.5.340.0040.02815.94
5.5.330.0050.02717.21
5.5.320.0180.03517.18
5.5.310.0160.04117.24
5.5.300.0080.01816.18
5.5.290.0070.02816.21
5.5.280.0050.03717.68
5.5.270.0050.04017.40
5.5.260.0050.03917.43
5.5.250.0000.02917.54
5.5.240.0150.03016.96
5.5.230.0070.01014.23
5.5.220.0040.00814.19
5.5.210.0040.00714.36
5.5.200.0030.00914.41
5.5.190.0080.00414.04
5.5.180.0090.00314.39
5.5.170.0110.00714.34
5.5.160.0040.01214.16
5.5.150.0100.00614.25
5.5.140.0040.00814.50
5.5.130.0090.00314.34
5.5.120.0080.00414.14
5.5.110.0090.00614.27
5.5.100.0050.00914.25
5.5.90.0060.00614.27
5.5.80.0030.01214.30
5.5.70.0060.00314.44
5.5.60.0100.00314.28
5.5.50.0070.00714.30
5.5.40.0090.00014.07
5.5.30.0030.00914.19
5.5.20.0000.01314.36
5.5.10.0060.00614.44
5.5.00.0030.01414.44
5.4.450.0120.03015.27
5.4.440.0200.02215.23
5.4.430.0220.02015.48
5.4.420.0140.02515.37
5.4.410.0230.01815.15
5.4.400.0220.01815.08
5.4.390.0420.02315.20
5.4.380.0230.02514.72
5.4.370.0220.03014.92
5.4.360.0220.02514.75
5.4.350.0150.03614.62
5.4.340.0170.03314.90
5.4.330.0070.00710.88
5.4.320.0110.01911.79
5.4.310.0050.02311.78
5.4.300.0020.02611.89
5.4.290.0050.03011.65
5.4.280.0070.02911.85
5.4.270.0070.03411.74
5.4.260.0070.03911.54
5.4.250.0060.03311.80
5.4.240.0080.02911.63
5.4.230.0070.03111.68
5.4.220.0040.02611.52
5.4.210.0060.03911.82
5.4.200.0040.02611.67
5.4.190.0080.01911.69
5.4.180.0060.02311.68
5.4.170.0130.05311.71
5.4.160.0050.02611.73
5.4.150.0070.02411.81
5.4.140.0090.03111.41
5.4.130.0100.03911.42
5.4.120.0060.02611.67
5.4.110.0050.02211.57
5.4.100.0060.02211.63
5.4.90.0100.02211.36
5.4.80.0070.04511.46
5.4.70.0100.03911.60
5.4.60.0140.06011.59
5.4.50.0060.02211.34
5.4.40.0050.02911.57
5.4.30.0120.03611.58
5.4.20.0080.03511.51
5.4.10.0030.03611.49
5.4.00.0110.02811.24
5.3.290.0020.03411.76
5.3.280.0100.02811.73
5.3.270.0080.04511.71
5.3.260.0090.04411.73
5.3.250.0070.03511.73
5.3.240.0040.03811.67
5.3.230.0130.02511.64
5.3.220.0060.03511.56
5.3.210.0070.03211.45
5.3.200.0040.02611.56
5.3.190.0070.03011.59
5.3.180.0090.03911.59
5.3.170.0040.03811.63
5.3.160.0050.03111.63
5.3.150.0080.03011.63
5.3.140.0100.03011.50
5.3.130.0100.04211.63
5.3.120.0090.03211.49
5.3.110.0120.03011.67
5.3.100.0080.03011.32
5.3.90.0100.03511.30
5.3.80.0060.02811.30
5.3.70.0090.03311.31
5.3.60.0140.03811.32
5.3.50.0130.03411.27
5.3.40.0080.02611.32
5.3.30.0110.03811.34
5.3.20.0100.03011.18
5.3.10.0150.04611.08
5.3.00.0060.03911.05
5.2.170.0330.0919.23
5.2.160.0100.0569.23
5.2.150.0070.0649.23
5.2.140.0120.0469.23
5.2.130.0090.0399.19
5.2.120.0170.0569.19
5.2.110.0070.0509.20
5.2.100.0100.0349.19
5.2.90.0100.0329.19
5.2.80.0050.0349.19
5.2.70.0060.0329.18
5.2.60.0040.0409.14
5.2.50.0100.0559.11
5.2.40.0150.0539.09
5.2.30.0090.0469.06
5.2.20.0110.0449.05
5.2.10.0060.0348.96
5.2.00.0070.0478.82
5.1.60.0050.0278.10
5.1.50.0050.0378.10
5.1.40.0070.0268.08
5.1.30.0100.0268.43
5.1.20.0060.0308.45
5.1.10.0060.0288.18
5.1.00.0040.0318.18
5.0.50.0070.0206.66
5.0.40.0050.0206.51
5.0.30.0030.0346.32
5.0.20.0020.0236.28
5.0.10.0060.0206.26
5.0.00.0070.0446.25
4.4.90.0060.0264.77
4.4.80.0100.0354.76
4.4.70.0050.0174.76
4.4.60.0030.0174.75
4.4.50.0030.0164.77
4.4.40.0060.0344.71
4.4.30.0040.0224.76
4.4.20.0030.0224.84
4.4.10.0040.0324.85
4.4.00.0040.0334.76
4.3.110.0030.0234.67
4.3.100.0040.0214.66
4.3.90.0060.0184.63
4.3.80.0080.0264.58
4.3.70.0060.0194.63
4.3.60.0050.0204.63
4.3.50.0050.0224.63
4.3.40.0070.0424.54
4.3.30.0070.0363.30
4.3.20.0060.0223.28
4.3.10.0040.0203.24
4.3.00.0030.03016.15

preferences:
51.79 ms | 401 KiB | 5 Q