3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $classB, $classC; public function __construct(){ // Do stuff that should only be initialized once // Then later : $this -> classB = new B(); $this -> classC = new C(); } } Class B { public function __construct(){ } public function sayHi() { echo 'hi'; } } Class C extends A { public function __construct() { parent::__construct(); $this -> classB -> sayHi(); } } $test = new A();

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.0740.06778.58
8.3.50.1260.03580.41
8.3.40.0360.02046.60
8.3.30.0360.01346.84
8.3.20.0160.01348.21
8.3.10.0190.00949.78
8.3.00.0230.02045.79
8.2.180.1000.03378.89
8.2.170.0300.02346.58
8.2.160.0420.01648.18
8.2.150.0180.01146.80
8.2.140.0200.01046.96
8.2.130.0220.00648.26
8.2.120.0180.00045.45
8.2.110.0200.01347.03
8.2.100.0360.02045.66
8.2.90.0160.01346.80
8.2.80.0140.01445.00
8.2.70.0110.01845.09
8.2.60.0140.01845.66
8.2.50.0140.01745.13
8.2.40.0190.01345.72
8.2.30.0090.01946.06
8.2.20.0180.01545.59
8.2.10.0100.01745.87
8.2.00.0160.01645.44
8.1.280.0520.03378.40
8.1.270.0100.02150.16
8.1.260.0170.01048.13
8.1.250.0130.01649.95
8.1.240.0290.00750.07
8.1.230.0380.01046.72
8.1.220.0060.02345.54
8.1.210.0200.01045.23
8.1.200.0210.01145.10
8.1.190.0180.01244.85
8.1.180.0170.01044.97
8.1.170.0170.01746.39
8.1.160.0150.01249.80
8.1.150.0140.01746.39
8.1.140.0130.01645.13
8.1.130.0100.01645.69
8.1.120.0100.02045.28
8.1.110.0180.01245.29
8.1.100.0130.01345.30
8.1.90.0160.01345.36
8.1.80.0260.00645.23
8.1.70.0170.01445.21
8.1.60.0260.00745.52
8.1.50.0180.01445.45
8.1.40.0290.00645.49
8.1.30.0170.01345.55
8.1.20.0110.02245.54
8.1.10.0270.02779.63
8.1.00.0420.02379.49
8.0.300.0360.02078.97
8.0.290.0130.03978.81
8.0.280.0250.02280.30
8.0.270.0330.01679.14
8.0.260.0300.02679.16
8.0.250.0270.01778.79
8.0.240.0320.02578.71
8.0.230.0200.02778.59
8.0.220.0260.01978.68
8.0.210.0310.01778.58
8.0.200.0310.01778.70
8.0.190.0270.02778.64
8.0.180.0340.02478.73
8.0.170.0380.02978.78
8.0.160.0300.02378.77
8.0.150.0350.02678.62
8.0.140.0390.02278.66
8.0.130.0730.063133.79
8.0.120.0230.03378.67
8.0.110.0130.03778.58
8.0.100.0160.02978.61
8.0.90.0130.03978.72
8.0.80.0880.07578.73
8.0.70.0160.02978.58
8.0.60.0170.02878.73
8.0.50.0210.03478.64
8.0.30.0860.06978.97
8.0.20.0710.06678.87
8.0.10.0240.02778.91
8.0.00.0760.07578.60
7.4.330.0450.02175.04
7.4.320.0240.03178.25
7.4.300.0290.02378.28
7.4.290.0460.03378.31
7.4.280.0380.02678.28
7.4.270.0330.02078.31
7.4.260.0310.02178.33
7.4.250.0160.03978.31
7.4.240.0200.02978.35
7.4.230.0240.03078.50
7.4.220.0810.06578.35
7.4.210.0770.04378.50
7.4.200.0300.02778.14
7.4.160.0730.07078.15
7.4.150.0770.05878.32
7.4.140.0740.06678.37
7.4.130.0730.07178.37
7.4.120.0630.06778.46
7.4.110.0690.09278.44
7.4.100.0590.06578.36
7.4.90.0550.06578.50
7.4.80.0850.06878.06
7.4.70.0710.06478.16
7.4.60.0750.08278.33
7.4.50.0200.03778.54
7.4.40.0510.07578.45
7.4.30.0820.04378.34
7.4.00.0370.04076.92
7.3.330.0360.053133.61
7.3.320.0610.034133.65
7.3.310.0350.01678.38
7.3.300.0330.01778.35
7.3.290.0550.08378.40
7.3.280.0710.07778.35
7.3.270.0890.06478.42
7.3.260.0650.08278.44
7.3.250.0970.07578.46
7.3.240.0690.07678.37
7.3.230.0690.05678.28
7.3.210.0570.08178.59
7.3.200.0670.06078.33
7.3.190.0710.07578.38
7.3.180.0560.07378.30
7.3.170.0640.09478.42
7.3.160.0720.08378.56
7.3.120.0240.04876.85
7.3.110.0350.04176.79
7.3.100.0360.03276.87
7.3.90.0300.03676.60
7.3.80.0230.04676.88
7.3.70.0300.04377.02
7.3.60.0240.05276.81
7.3.50.0410.03476.68
7.3.40.0330.03976.75
7.3.30.0260.04676.64
7.3.20.0320.03278.87
7.3.10.0230.04078.84
7.3.00.0240.04178.85
7.2.330.0780.05278.46
7.2.320.0530.07978.31
7.2.310.0640.08778.23
7.2.300.0610.06778.32
7.2.290.0650.07178.50
7.2.240.0270.05076.75
7.2.230.0360.04076.78
7.2.220.0360.03976.86
7.2.210.0310.04876.83
7.2.200.0430.03376.77
7.2.190.0290.04876.79
7.2.180.0260.04676.83
7.2.170.0400.04076.59
7.2.160.0270.05076.59
7.2.150.0420.03278.95
7.2.140.0260.03978.66
7.2.130.0270.04878.93
7.2.120.0290.04679.11
7.2.110.0560.02279.04
7.2.100.0360.03679.16
7.2.90.0230.04379.09
7.2.80.0900.03578.88
7.2.70.0370.04778.79
7.2.60.1100.03278.88
7.2.50.1190.04778.77
7.2.40.0380.05778.98
7.2.30.0290.06879.05
7.2.20.0340.06178.75
7.2.10.0340.06879.16
7.2.00.0530.05778.98
7.1.330.0360.05278.20
7.1.320.0520.04278.03
7.1.310.0330.04377.86
7.1.300.0390.03977.95
7.1.290.0140.05977.68
7.1.280.0270.05777.81
7.1.270.0520.04677.98
7.1.260.0270.05177.90
7.1.250.0270.04778.02
7.1.200.1850.05077.76
7.1.70.0550.03979.19
7.1.60.0330.05379.56
7.1.50.1120.04678.89
7.1.00.0100.12084.67
7.0.201.3080.03076.40
7.0.140.0200.10382.42
7.0.81.2970.10381.26
7.0.71.0770.05781.26
7.0.61.1400.04781.14
7.0.51.1270.11781.45
7.0.40.0200.11020.33
7.0.30.0130.06320.21
7.0.20.0270.12020.33
7.0.10.0130.12320.37
7.0.00.0170.08020.22
5.6.280.0170.11385.54
5.6.230.0200.07084.91
5.6.220.0270.05784.81
5.6.210.0170.06784.69
5.6.200.0330.10785.28
5.6.190.0330.10785.34
5.6.180.0430.05385.24
5.6.170.0400.09785.20
5.6.160.0330.12085.17
5.6.150.0270.13085.26
5.6.140.0330.09785.30
5.6.130.0430.09085.24
5.6.120.0200.07785.12
5.6.110.0230.12085.30
5.6.100.0330.08385.32
5.6.90.0500.10385.17
5.6.80.0300.12084.55
5.6.70.0500.09784.68
5.6.60.0370.10384.64
5.6.50.0230.11084.63
5.6.40.0300.10784.60
5.6.30.0370.11784.61
5.6.20.0370.10384.63
5.6.10.0570.09084.63
5.6.00.0500.08784.60
5.5.370.0270.11384.52
5.5.360.0200.06784.62
5.5.350.0330.09384.51
5.5.340.0330.10085.09
5.5.330.0330.10385.11
5.5.320.0370.12084.92
5.5.310.0300.11385.11
5.5.300.0370.11385.07
5.5.290.0170.13085.06
5.5.280.0300.10785.05
5.5.270.0470.10084.88
5.5.260.0270.11085.04
5.5.250.0330.10784.89
5.5.240.0200.09084.47
5.5.230.0270.11384.35
5.5.220.0170.07784.48
5.5.210.0170.07084.42
5.5.200.0430.08784.29
5.5.190.0370.10384.33
5.5.180.0470.08784.44
5.5.160.0330.11784.43
5.5.150.0430.11084.46
5.5.140.0270.10084.40
5.5.130.0470.10084.38
5.5.120.0300.08784.40
5.5.110.0230.13384.41
5.5.100.0300.11384.13
5.5.90.0170.07384.28
5.5.80.0200.08084.12
5.5.70.0230.11784.09
5.5.60.0230.10784.20
5.5.50.0470.08784.18
5.5.40.0300.11384.26
5.5.30.0270.08784.29
5.5.20.0230.10784.23
5.5.10.0370.10784.21
5.5.00.0200.12084.15
5.4.450.0430.06783.81
5.4.440.0230.12083.72
5.4.430.0200.08083.92
5.4.420.0300.11083.73
5.4.410.0170.09783.79
5.4.400.0330.07383.37
5.4.390.0230.07383.51
5.4.380.0330.10083.60
5.4.370.0200.07083.44
5.4.360.0330.08383.41
5.4.350.0100.13383.32
5.4.340.0430.09783.44
5.4.320.0230.12383.45
5.4.310.0330.10083.51
5.4.300.0430.11083.63
5.4.290.0200.12083.28
5.4.280.0300.07383.41
5.4.270.0300.08383.50
5.4.260.0330.10783.28
5.4.250.0270.09083.59
5.4.240.0230.10083.40
5.4.230.0230.06783.59
5.4.220.0230.10083.63
5.4.210.0170.09083.30
5.4.200.0430.10383.52
5.4.190.0330.11083.43
5.4.180.0230.11783.40
5.4.170.0330.07083.45
5.4.160.0330.09783.34
5.4.150.0300.06383.42
5.4.140.0130.09080.89
5.4.130.0270.11780.87
5.4.120.0530.09080.70
5.4.110.0470.09780.89
5.4.100.0270.11380.91
5.4.90.0500.07380.75
5.4.80.0230.11080.79
5.4.70.0430.05780.91
5.4.60.0330.10080.78
5.4.50.0330.10780.91
5.4.40.0400.09080.79
5.4.30.0230.11380.82
5.4.20.0230.11080.75
5.4.10.0170.12780.69
5.4.00.0170.08780.34
5.3.290.0270.13775.65
5.3.280.0400.10075.55
5.3.270.0400.11375.73
5.3.260.0300.12075.46
5.3.250.0200.08075.69
5.3.240.0230.11775.57
5.3.230.0230.08775.48
5.3.220.0170.13375.57
5.3.210.0400.10075.40
5.3.200.0200.12775.48
5.3.190.0200.12375.39
5.3.180.0200.09075.43
5.3.170.0300.11075.59
5.3.160.0270.10775.43
5.3.150.0330.10775.46
5.3.140.0370.07075.41
5.3.130.0330.10075.58
5.3.120.0130.10375.43
5.3.110.0200.11375.41
5.3.100.0370.12375.00
5.3.90.0270.12774.91
5.3.80.0270.13074.86
5.3.70.0270.11774.84
5.3.60.0370.10074.76
5.3.50.0470.11074.70
5.3.40.0230.09074.75
5.3.30.0270.13074.76
5.3.20.0330.11074.43
5.3.10.0270.11374.59
5.3.00.0270.10774.48
5.2.170.0030.04026.05
5.2.160.0130.03725.92
5.2.150.0130.04725.99
5.2.140.0170.04026.07
5.2.130.0030.04725.92
5.2.120.0130.07025.98
5.2.110.0100.03725.75
5.2.100.0100.07025.90
5.2.90.0100.07025.90
5.2.80.0200.04725.89
5.2.70.0130.05025.82
5.2.60.0070.07325.81
5.2.50.0270.06326.05
5.2.40.0130.05325.92
5.2.30.0130.06326.00
5.2.20.0100.05026.12
5.2.10.0130.03726.80
5.2.00.0030.04325.74
5.1.60.0070.06726.92
5.1.50.0100.06726.93
5.1.40.0070.06726.99
5.1.30.0170.05727.14
5.1.20.0130.06027.40
5.1.10.0170.06726.99
5.1.00.0200.06027.00
5.0.50.0100.04026.43
5.0.40.0100.06326.45
5.0.30.0070.07326.22
5.0.20.0130.05326.20
5.0.10.0100.06025.88
5.0.00.0170.08743.77
4.4.90.0030.03712.64
4.4.80.0100.01712.64
4.4.70.0030.03312.64
4.4.60.0030.02712.64
4.4.50.0030.02012.64
4.4.40.0030.03012.64
4.4.30.0000.03012.64
4.4.20.0030.03712.64
4.4.10.0030.02312.64
4.4.00.0000.05712.64
4.3.110.0000.03012.64
4.3.100.0000.02012.64
4.3.90.0030.03312.64
4.3.80.0000.05312.64
4.3.70.0100.01712.64
4.3.60.0070.01312.64
4.3.50.0070.03312.64
4.3.40.0030.05012.64
4.3.30.0000.02712.64
4.3.20.0030.02312.64
4.3.10.0000.03312.64
4.3.00.0070.02712.64

preferences:
41.09 ms | 401 KiB | 5 Q