3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassicLazyFoo extends Foo { private $initialized = false; public function getBar() { $this->init(); return parent::getBar(); } private function init() { if ($this->initialized) { return; } \Closure::bind(function() { $this->bar = 'Loaded from DB!'; }, $this, get_parent_class($this))->__invoke(); } } var_dump((new ClassicLazyFoo())->getBar());

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.0070.00718.54
8.3.50.0120.00318.16
8.3.40.0120.00318.84
8.3.30.0100.00719.04
8.3.20.0000.00820.21
8.3.10.0080.00020.50
8.3.00.0000.00819.26
8.2.180.0080.00818.41
8.2.170.0070.00722.96
8.2.160.0100.00720.38
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00322.29
8.2.110.0000.00922.29
8.2.100.0080.00417.72
8.2.90.0090.00019.23
8.2.80.0030.00517.97
8.2.70.0050.00517.75
8.2.60.0030.00617.92
8.2.50.0050.00518.07
8.2.40.0030.00618.16
8.2.30.0070.00019.26
8.2.20.0040.00417.68
8.2.10.0030.00618.08
8.2.00.0050.00217.69
8.1.280.0060.01325.92
8.1.270.0060.00322.17
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00322.07
8.1.230.0040.00819.01
8.1.220.0040.00417.74
8.1.210.0000.01018.77
8.1.200.0040.00417.23
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0000.00918.58
8.1.160.0040.00422.02
8.1.150.0040.00418.84
8.1.140.0040.00417.35
8.1.130.0000.00717.81
8.1.120.0000.00717.41
8.1.110.0050.00317.36
8.1.100.0000.00717.25
8.1.90.0000.00717.43
8.1.80.0060.00517.45
8.1.70.0000.00717.41
8.1.60.0050.00517.41
8.1.50.0000.00917.51
8.1.40.0040.00417.46
8.1.30.0000.00817.59
8.1.20.0030.00517.50
8.1.10.0000.00717.39
8.1.00.0060.00617.47
8.0.300.0050.00218.77
8.0.290.0000.00816.63
8.0.280.0000.00718.45
8.0.270.0030.00317.21
8.0.260.0000.00617.31
8.0.250.0000.00717.03
8.0.240.0040.00416.95
8.0.230.0000.00717.05
8.0.220.0000.00716.91
8.0.210.0040.00416.93
8.0.200.0000.00817.03
8.0.190.0040.00416.91
8.0.180.0000.00717.00
8.0.170.0030.00517.05
8.0.160.0040.00416.94
8.0.150.0000.00816.95
8.0.140.0030.00316.80
8.0.130.0050.00013.41
8.0.120.0040.00416.83
8.0.110.0070.00016.86
8.0.100.0050.00316.83
8.0.90.0070.00016.79
8.0.80.0040.01116.92
8.0.70.0040.00416.95
8.0.60.0000.00716.83
8.0.50.0070.00016.82
8.0.30.0140.00717.11
8.0.20.0120.00717.40
8.0.10.0050.00317.07
8.0.00.0090.01216.73
7.4.330.0000.00515.00
7.4.320.0040.00416.55
7.4.300.0000.00716.37
7.4.290.0050.00316.36
7.4.280.0000.00816.43
7.4.270.0030.00316.52
7.4.260.0000.00716.43
7.4.250.0040.00416.45
7.4.240.0050.00216.46
7.4.230.0000.00716.25
7.4.220.0180.00616.50
7.4.210.0060.00916.55
7.4.200.0000.00716.27
7.4.160.0080.00816.54
7.4.150.0060.01317.40
7.4.140.0070.01117.86
7.4.130.0060.01216.51
7.4.120.0110.00616.53
7.4.110.0090.01316.27
7.4.100.0130.00916.53
7.4.90.0100.01016.32
7.4.80.0100.00719.37
7.4.70.0130.00616.59
7.4.60.0110.01116.55
7.4.50.0000.00616.43
7.4.40.0060.01416.44
7.4.30.0030.01316.64
7.4.00.0040.01214.79
7.3.330.0030.00313.31
7.3.320.0050.00013.12
7.3.310.0040.00316.17
7.3.300.0030.00316.18
7.3.290.0090.00616.32
7.3.280.0120.00516.28
7.3.270.0070.01117.40
7.3.260.0170.00016.32
7.3.250.0100.00616.41
7.3.240.0030.01316.37
7.3.230.0030.01316.39
7.3.210.0200.00316.40
7.3.200.0030.01319.39
7.3.190.0110.00516.29
7.3.180.0030.01316.29
7.3.170.0080.00816.46
7.3.160.0090.00916.32
7.2.330.0070.01016.30
7.2.320.0030.01416.43
7.2.310.0170.00016.66
7.2.300.0130.00316.49
7.2.290.0100.01316.50
7.2.110.0910.00616.16
7.2.100.0020.01016.16
7.2.90.0060.00916.57
7.2.80.0090.00616.17
7.2.70.0450.01016.69
7.2.60.0080.00616.73
7.2.50.0160.00616.64
7.2.40.0360.00316.86
7.2.30.0130.00716.51
7.2.20.0140.00716.69
7.2.10.0320.00316.70
7.2.00.0170.00316.79
7.1.230.0120.00215.68
7.1.220.1940.00615.70
7.1.210.0130.00415.73
7.1.200.0080.00715.64
7.1.190.0110.00915.68
7.1.180.0070.00715.61
7.1.170.0510.01015.29
7.1.160.0090.00615.70
7.1.150.0130.00415.54
7.1.140.0200.00815.64
7.1.130.0110.00515.43
7.1.120.0210.00915.71
7.1.110.0140.00515.83
7.1.100.0040.00915.59
7.1.90.0140.00215.75
7.1.80.0050.01415.31
7.1.70.0070.00716.15
7.1.60.0140.00917.57
7.1.50.0100.01016.30
7.1.40.0130.00715.82
7.1.30.0180.00915.73
7.1.20.0170.00015.89
7.1.10.0140.00415.36
7.1.00.0080.03818.92
7.0.310.0180.00015.32
7.0.300.0110.00715.00
7.0.290.0070.01115.20
7.0.280.0030.01015.27
7.0.270.0120.00414.92
7.0.260.0050.01014.96
7.0.250.0300.00715.30
7.0.240.0070.01115.33
7.0.230.0250.00315.43
7.0.220.0130.00615.19
7.0.210.0110.00515.21
7.0.200.0060.00516.01
7.0.190.0050.00915.34
7.0.180.0120.00315.32
7.0.170.0080.00815.29
7.0.160.0140.00515.30
7.0.150.0080.00615.44
7.0.140.0070.04018.57
7.0.130.0100.00715.23
7.0.120.0080.00615.10
7.0.110.0100.00315.36
7.0.100.0130.00615.32
7.0.90.0090.00915.33
7.0.80.0090.00615.01
7.0.70.0580.00615.27
7.0.60.0060.02217.50
7.0.50.0130.02416.65
7.0.40.0100.03216.67
7.0.30.0220.03816.56
7.0.20.0160.02016.87
7.0.10.0060.03216.74
7.0.00.0100.04016.81
5.6.380.0120.00014.14
5.6.370.0060.00914.26
5.6.360.0110.00614.11
5.6.350.0090.00614.24
5.6.340.0120.00414.28
5.6.330.0120.00313.96
5.6.320.0140.00014.28
5.6.310.0110.00414.30
5.6.300.0110.00514.23
5.6.290.0180.00014.31
5.6.280.0110.03617.53
5.6.270.0100.00614.42
5.6.260.0090.00614.26
5.6.250.0060.00914.18
5.6.240.0150.00014.22
5.6.230.0110.00513.97
5.6.220.0100.00514.09
5.6.210.0080.03617.16
5.6.200.0070.02416.28
5.6.190.0090.02217.43
5.6.180.0230.02717.45
5.6.170.0190.04217.34
5.6.160.0070.04617.29
5.6.150.0070.04516.20
5.6.140.0080.04316.17
5.6.130.0130.04216.11
5.6.120.0090.04317.52
5.6.110.0060.02617.56
5.6.100.0110.04017.62
5.6.90.0110.04217.63
5.6.80.0050.02417.19
5.6.70.0110.00414.03
5.6.60.0070.00714.09
5.6.50.0120.00913.98
5.6.40.0180.00214.05
5.6.30.0130.00413.84
5.6.20.0060.01213.97
5.6.10.0160.00313.96
5.6.00.0030.01314.12
5.5.380.0140.00012.79
5.5.370.0060.00612.79
5.5.360.0080.00412.79
5.5.350.0100.03016.61
5.5.340.0090.03515.37
5.5.330.0090.02016.61
5.5.320.0260.03816.53
5.5.310.0150.03016.58
5.5.300.0070.02215.41
5.5.290.0110.02915.36
5.5.280.0090.04216.77
5.5.270.0120.03416.88
5.5.260.0110.04316.82
5.5.250.0130.04116.76
5.5.240.0120.04016.47
5.5.230.0070.00712.79
5.5.220.0070.00712.79
5.5.210.0040.00812.79
5.5.200.0030.00912.79
5.5.190.0050.00512.79
5.5.180.0070.00712.79
5.5.170.0070.00714.11
5.5.160.0110.00312.79
5.5.150.0040.01112.79
5.5.140.0110.00312.79
5.5.130.0130.00012.79
5.5.120.0080.00412.79
5.5.110.0080.00412.79
5.5.100.0050.00712.79
5.5.90.0120.00412.79
5.5.80.0070.00412.79
5.5.70.0080.00812.79
5.5.60.0030.00912.79
5.5.50.0100.00312.79
5.5.40.0090.00612.79
5.5.30.0080.00412.79
5.5.20.0040.00912.79
5.5.10.0040.00712.79
5.5.00.0080.00512.79
5.4.450.0210.02816.05
5.4.440.0390.03216.18
5.4.430.0530.03315.99
5.4.420.0390.00316.17
5.4.410.0360.00216.05
5.4.400.0340.00515.91
5.4.390.0410.00215.96
5.4.380.0280.02715.76
5.4.370.0230.02515.77
5.4.360.0160.03015.80
5.4.350.0130.03315.81
5.4.340.0270.03015.65
5.4.330.0090.00012.79
5.4.320.0070.02012.65
5.4.310.0070.02012.65
5.4.300.0050.02412.65
5.4.290.0080.01912.65
5.4.280.0090.01912.60
5.4.270.0090.01912.60
5.4.260.0040.02512.59
5.4.250.0110.01712.60
5.4.240.0070.02212.60
5.4.230.0060.02212.59
5.4.220.0080.01912.59
5.4.210.0060.01912.59
5.4.200.0050.02312.59
5.4.190.0020.02412.59
5.4.180.0050.02112.59
5.4.170.0080.01812.59
5.4.160.0070.02112.59
5.4.150.0060.02112.59
5.4.140.0060.02112.43
5.4.130.0100.01712.43
5.4.120.0080.01812.41
5.4.110.0080.01812.40
5.4.100.0090.01812.40
5.4.90.0050.02212.41
5.4.80.0060.02012.40
5.4.70.0080.01912.40
5.4.60.0070.02112.40
5.4.50.0060.02112.40
5.4.40.0090.02212.40
5.4.30.0060.02012.40
5.4.20.0070.02012.39
5.4.10.0090.01712.40
5.4.00.0070.02312.14
5.3.290.0100.02212.79
5.3.280.0100.01612.75
5.3.270.0040.02512.76
5.3.260.0020.02512.75
5.3.250.0050.02112.75
5.3.240.0080.02112.76
5.3.230.0040.02612.75
5.3.220.0070.02312.73
5.3.210.0050.02212.73
5.3.200.0100.01712.73
5.3.190.0080.02012.73
5.3.180.0050.02312.73
5.3.170.0050.02212.73
5.3.160.0060.02112.73
5.3.150.0060.02612.73
5.3.140.0050.02712.72
5.3.130.0060.02112.72
5.3.120.0080.01912.72
5.3.110.0090.01912.72
5.3.100.0080.01912.47
5.3.90.0060.02212.46
5.3.80.0090.01612.45
5.3.70.0050.02212.46
5.3.60.0020.02512.45
5.3.50.0070.02312.42
5.3.40.0130.01512.42
5.3.30.0080.01812.40
5.3.20.0020.02512.29
5.3.10.0070.01912.27
5.3.00.0080.01912.27
5.2.170.0080.01411.01
5.2.160.0040.01911.01
5.2.150.0060.01711.01
5.2.140.0040.01911.00
5.2.130.0060.02210.98
5.2.120.0050.01510.99
5.2.110.0060.01610.99
5.2.100.0080.01610.99
5.2.90.0060.02210.99
5.2.80.0090.02010.99
5.2.70.0100.02110.99
5.2.60.0070.02510.96
5.2.50.0080.02110.94
5.2.40.0060.02110.93
5.2.30.0080.02110.92
5.2.20.0050.01810.91
5.2.10.0040.01810.87
5.2.00.0060.01410.80
5.1.60.0040.01910.44
5.1.50.0070.01310.44
5.1.40.0070.01310.43
5.1.30.0040.01610.60
5.1.20.0070.01910.62
5.1.10.0040.01710.48
5.1.00.0040.01510.48
5.0.50.0050.0109.72
5.0.40.0040.0129.65
5.0.30.0060.0159.55
5.0.20.0070.0099.54
5.0.10.0030.0129.53
5.0.00.0020.0229.52
4.4.90.0050.0098.79
4.4.80.0010.0118.77
4.4.70.0030.0098.77
4.4.60.0010.0128.77
4.4.50.0040.0088.78
4.4.40.0030.0148.75
4.4.30.0020.0118.77
4.4.20.0010.0118.82
4.4.10.0020.0108.82
4.4.00.0030.0138.77
4.3.110.0040.0088.73
4.3.100.0030.0108.73
4.3.90.0040.0088.71
4.3.80.0030.0148.69
4.3.70.0020.0108.71
4.3.60.0040.0098.71
4.3.50.0060.0088.71
4.3.40.0020.0148.66
4.3.30.0040.0088.04
4.3.20.0040.0098.04
4.3.10.0020.0098.01
4.3.00.0180.00713.55

preferences:
53.8 ms | 400 KiB | 5 Q