3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); phpversion() >= "7.0.0" or die(); class FooBar { public $prop = '123'; } class BarFoo { public $prop = '312'; } function test () : FooBar { return new FooBar; } function test1 () : BarFoo { return new FooBar; } var_dump(test1()); var_dump(test());

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)
7.2.00.0040.00819.47
7.1.100.0090.00617.95
7.1.70.0000.00817.22
7.1.60.0130.00719.44
7.1.50.0060.00916.72
7.1.00.0030.07722.46
7.0.200.0060.00316.46
7.0.60.0070.07319.89
7.0.50.0130.07317.74
7.0.40.0070.05319.97
7.0.30.0270.04320.07
7.0.20.0230.04020.06
7.0.10.0130.08320.30
7.0.00.0030.04320.24
5.6.280.0030.03320.90
5.6.210.0030.04020.69
5.6.200.0070.08018.20
5.6.190.0070.04020.57
5.6.180.0230.06320.64
5.6.170.0130.06020.44
5.6.160.0030.08720.48
5.6.150.0000.04318.23
5.6.140.0030.04318.28
5.6.130.0070.08318.11
5.6.120.0000.05321.02
5.6.110.0000.06020.90
5.6.100.0000.08021.01
5.6.90.0100.06321.13
5.6.80.0070.05720.41
5.5.350.0070.04320.47
5.5.340.0070.03718.09
5.5.330.0130.07020.14
5.5.320.0430.04320.52
5.5.310.0130.04320.25
5.5.300.0030.04017.92
5.5.290.0000.04317.91
5.5.280.0130.04720.89
5.5.270.0000.04720.87
5.5.260.0130.08320.76
5.5.250.0030.08320.61
5.5.240.3230.04020.07

preferences:
33.98 ms | 401 KiB | 5 Q