3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FakeStringIntTuple { private $data = []; public function returnsCallable() { return $this; } public function __invoke(string $a, int $b) { $this->data[] = [$a, $b]; return $this; } } $tuple = (new FakeStringIntTuple())('foo', 123); var_dump($tuple); $tuple = new FakeStringIntTuple(); $tuple->returnsCallable()('bar', 456); var_dump($tuple); $tuple = (new FakeStringIntTuple()) ('foo', 123) ('bar', 456) ('baz', 789); var_dump($tuple);
based on 4N9if

Here you find the average performance (time & memory) of each version. A greyed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.0alpha10.0080.00412.82
7.2.60.0060.00616.67
7.2.30.0090.01019.93
7.2.20.0060.01419.75
7.2.10.0080.01619.54
7.2.00.0110.01419.64
7.1.150.0120.00618.56
7.1.140.0090.01318.21
7.1.130.0100.01118.46
7.1.120.0130.00918.37
7.1.110.0060.01517.87
7.1.100.0060.01217.91
7.1.90.0070.01217.64
7.1.80.0080.00917.82
7.1.70.0100.00717.06
7.1.60.0300.01834.98
7.1.50.0270.01334.88
7.1.40.0280.01834.34
7.1.30.0220.01734.63
7.1.20.0250.01334.52
7.1.10.0050.01216.54
7.1.00.0060.01216.65
7.0.270.0080.00818.39
7.0.260.0080.01418.19
7.0.250.0070.01317.68
7.0.240.0060.01617.49
7.0.230.0090.01117.39
7.0.220.0090.01217.71
7.0.210.0080.01316.30
7.0.200.0040.01116.62
7.0.190.0090.01116.81
7.0.180.0070.01016.46
7.0.170.0090.01216.37
7.0.160.0070.01116.40
7.0.150.0040.01216.37
7.0.140.0080.01216.27
7.0.130.0060.01016.55
7.0.120.0050.01116.64
7.0.110.0080.01416.05
7.0.100.0090.01216.21
7.0.90.0070.01416.27
7.0.80.0090.01216.55
7.0.70.0110.01116.20
7.0.60.0100.01416.13
7.0.50.0070.00916.48
7.0.40.0080.01216.36
7.0.30.0120.01116.60
7.0.20.0080.01416.29
7.0.10.0070.01316.37
7.0.00.0090.01216.25
hhvm-3.22.00.1160.26690.77
hhvm-3.21.30.1150.28290.16
hhvm-3.18.50.1200.28088.65
5.6.300.0160.06920.90
5.6.290.0180.08120.74
5.6.280.0240.06220.81
5.6.270.0160.07320.75
5.6.260.0200.05920.92
5.6.250.0230.07521.02
5.6.240.0210.08020.82
5.6.230.0210.08420.75
5.6.220.0190.07020.89
5.6.210.0180.08020.57
5.6.200.0170.06620.89
5.6.190.0150.06920.71
5.6.180.0270.07520.74
5.6.170.0220.08120.69
5.6.160.0240.07420.90
5.6.150.0220.07620.76
5.6.140.0170.07720.89
5.6.130.0190.07520.88
5.6.120.0160.07120.75
5.6.110.0120.06520.75
5.6.100.0160.06720.74
5.6.90.0220.07120.74
5.6.80.0170.07420.11
5.6.70.0200.06720.16
5.6.60.0150.06820.10
5.6.50.0160.07520.05
5.6.40.0190.07020.04
5.6.30.0240.06220.08
5.6.20.0220.07020.04
5.6.10.0200.06120.17
5.6.00.0220.05820.24