3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct() { echo 'foo'; } } class Bar { public function __construct() { echo 'bar'; } } class Build { private ?Foo $foo = null; private ?Bar $bar = null; function foo(): Foo { return $this->foo ?? new Foo(); } function bar(): Bar { return $this->bar ??= new Bar(); } } $build = new Build(); $build->foo(); $build->foo(); $build->bar(); $build->bar();

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.130.0060.00417.55
8.4.120.0110.00820.46
8.4.110.0100.01122.44
8.4.100.0130.00817.98
8.4.90.0150.00522.50
8.4.80.0120.00917.93
8.4.70.0060.00818.00
8.4.60.0110.00618.83
8.4.50.0100.01022.50
8.4.40.0100.00719.41
8.4.30.0160.00319.00
8.4.20.0100.00718.07
8.4.10.0040.00423.87
8.3.260.0090.00916.58
8.3.250.0080.00820.73
8.3.240.0130.00618.28
8.3.230.0100.00916.70
8.3.220.0110.00818.91
8.3.210.0110.00818.34
8.3.200.0060.00316.48
8.3.190.0060.00316.89
8.3.180.0100.01018.25
8.3.170.0110.00717.22
8.3.160.0030.01418.47
8.3.150.0090.00916.50
8.3.140.0030.00717.25
8.3.130.0060.00318.25
8.3.120.0050.00318.96
8.3.110.0060.00320.94
8.3.100.0160.00324.06
8.3.90.0030.00626.77
8.3.80.0060.00317.97
8.3.70.0130.00616.63
8.3.60.0110.01116.63
8.3.50.0100.01016.47
8.3.40.0130.00320.09
8.3.30.0060.01018.63
8.3.20.0030.01224.18
8.3.10.0130.00624.66
8.3.00.0090.00026.16
8.2.290.0070.01120.36
8.2.280.0080.01018.57
8.2.270.0140.00717.30
8.2.260.0060.01216.71
8.2.250.0040.00416.67
8.2.240.0040.00418.89
8.2.230.0040.00422.58
8.2.220.0030.01637.54
8.2.210.0140.00326.77
8.2.200.0060.00318.16
8.2.190.0110.00416.58
8.2.180.0090.00918.29
8.2.170.0040.01118.94
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0040.00426.16
8.2.110.0040.00422.11
8.2.100.0040.00817.72
8.2.90.0060.00317.75
8.2.80.0000.00818.91
8.2.70.0030.00517.50
8.2.60.0000.00817.63
8.2.50.0040.00417.63
8.2.40.0080.00418.29
8.2.30.0080.00817.72
8.2.20.0080.00817.72
8.2.10.0120.00517.72
8.2.00.0140.00217.72
8.1.330.0100.00821.66
8.1.320.0050.01416.24
8.1.310.0000.00818.39
8.1.300.0160.00319.37
8.1.290.0030.00630.84
8.1.280.0100.01425.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00323.71
8.1.230.0030.00921.04
8.1.220.0080.00018.62
8.1.210.0040.00418.77
8.1.200.0000.01117.35
8.1.190.0030.00917.53
8.1.180.0060.00318.10
8.1.170.0080.00417.90
8.1.160.0150.00017.72
8.1.150.0130.00317.72
8.1.140.0100.00517.72
8.1.130.0160.00017.72
8.1.120.0050.01017.72
8.1.110.0100.00617.72
8.1.100.0120.00417.72
8.1.90.0100.00517.72
8.1.80.0100.00517.72
8.1.70.0140.00517.72
8.1.60.0070.01117.72
8.1.50.0110.00617.72
8.1.40.0120.00517.72
8.1.30.0130.00517.72
8.1.20.0150.00417.72
8.1.10.0150.00217.72
8.1.00.0160.00217.72
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0120.00417.72
8.0.270.0130.00417.72
8.0.260.0160.00017.72
8.0.250.0080.00817.72
8.0.240.0140.00317.72
8.0.230.0170.00817.72
8.0.220.0130.00317.72
8.0.210.0050.01017.72
8.0.200.0100.00717.72
8.0.190.0060.01017.72
8.0.180.0130.00317.72
8.0.170.0120.00317.72
8.0.160.0150.00017.72
8.0.150.0120.00617.72
8.0.140.0110.00617.72
8.0.130.0120.00417.72
8.0.120.0120.00318.12
8.0.110.0110.00417.72
8.0.100.0160.00017.72
8.0.90.0050.01017.72
8.0.80.0170.00017.72
8.0.70.0110.00517.72
8.0.60.0120.00417.72
8.0.50.0090.00617.72
8.0.30.0160.00017.72
8.0.20.0060.01017.72
8.0.10.0080.00817.72

preferences:
28.1 ms | 403 KiB | 5 Q