3v4l.org

run code in 300+ PHP versions simultaneously
<?php final readonly class TestObject { public function __construct(public int $number) { echo "Constructor called\n"; } public function getLucky(): void { echo "Your lucky number: $this->number\n"; } } $lazy = new ReflectionClass(TestObject::class)->newLazyGhost(function (TestObject $object) { $object->__construct(42); }); echo "Object created\n"; $lazy->getLucky();

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.4.80.0280.00718.71
8.4.70.0230.01017.55
8.4.60.0150.00717.37
8.4.50.0150.00717.50
8.4.40.0210.00317.56
8.4.30.0170.00717.62
8.4.20.0210.00419.48
8.4.10.0190.00417.37
8.3.220.0050.00419.09
8.3.210.0190.00216.38
8.3.200.0170.00416.44
8.3.190.0150.00516.46
8.3.180.0150.00616.38
8.3.170.0200.00316.43
8.3.160.0170.00716.41
8.3.150.0180.00316.32
8.3.140.0200.00216.81
8.3.130.0140.00416.52
8.3.120.0200.00216.59
8.3.110.0150.00516.47
8.3.100.0150.00516.39
8.3.90.0190.00416.34
8.3.80.0190.00416.47
8.3.70.0170.00316.30
8.3.60.0180.00616.40
8.3.50.0180.00316.41
8.3.40.0160.00417.36
8.3.30.0140.00617.45
8.3.20.0140.00617.38
8.3.10.0140.00417.48
8.3.00.0080.00317.55
8.2.280.0140.00216.36
8.2.270.0140.00416.27
8.2.260.0160.00216.31
8.2.250.0150.00416.47
8.2.240.0210.00216.49
8.2.230.0270.00516.25
8.2.220.0310.00716.73
8.2.210.0310.01116.36
8.2.200.0330.00916.43
8.2.190.0230.00516.63
8.2.180.0330.00816.36
8.2.170.0370.00917.58
8.2.160.0370.00917.30
8.2.150.0370.00817.25
8.2.140.0360.00917.17
8.2.130.0390.00717.22
8.2.120.0470.00517.36
8.2.110.0290.00317.69
8.2.100.0140.00517.58
8.2.90.0160.00517.52
8.2.80.0190.00517.74
8.2.70.0210.00417.45
8.2.60.0150.00417.45
8.2.50.0210.00617.41
8.2.40.0320.00817.29
8.2.30.0340.00917.37
8.2.20.0250.00817.45
8.2.10.0150.00317.31
8.2.00.0190.00417.36

preferences:
139.01 ms | 995 KiB | 7 Q