3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Hi { protected $message = 'Hello'; public function setMessage(string $message) { $this->message = $message; } public function sayHello() : string { return $this->message; } } class CopyCat extends Hi { public function __construct(Hi $realThing) // should be a named constructor instead { $this->message = & $realThing->message; } public function sayHello() : string { return 'Meow! ' . $this->message; } } $hi = new Hi; $hi->setMessage('Hello'); $copyCat = new CopyCat($hi); var_dump($hi->sayHello()); var_dump($copyCat->sayHello()); $hi->setMessage('Hi'); var_dump($hi->sayHello()); var_dump($copyCat->sayHello());

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.5.30.0080.00917.76
8.5.20.0100.00720.26
8.5.10.0090.00720.17
8.5.00.0130.00920.06
8.4.180.0120.01021.44
8.4.170.0120.01020.61
8.4.160.0120.00921.46
8.4.150.0090.00416.77
8.4.140.0090.01117.61
8.4.130.0090.00819.31
8.4.120.0120.00720.69
8.4.110.0040.00622.54
8.4.100.0130.00817.82
8.4.90.0110.00818.61
8.4.80.0070.00317.75
8.4.70.0140.00317.96
8.4.60.0120.00718.73
8.4.50.0090.01018.91
8.4.40.0150.00320.46
8.4.30.0100.01017.83
8.4.20.0060.01317.32
8.4.10.0060.00317.66
8.3.300.0120.00920.93
8.3.290.0100.01120.75
8.3.280.0100.01118.38
8.3.270.0090.01116.76
8.3.260.0110.00516.60
8.3.250.0090.00918.91
8.3.240.0040.00416.94
8.3.230.0100.00716.20
8.3.220.0050.00317.30
8.3.210.0090.00918.36
8.3.200.0030.00616.74
8.3.190.0060.00318.71
8.3.180.0060.00516.50
8.3.170.0090.00920.63
8.3.160.0090.00617.32
8.3.150.0180.00317.27
8.3.140.0050.00316.89
8.3.130.0030.00716.69
8.3.120.0130.00320.65
8.3.110.0030.00616.62
8.3.100.0050.00516.65
8.3.90.0100.01026.77
8.3.80.0070.00416.63
8.3.70.0080.00816.58
8.3.60.0140.00418.43
8.3.50.0150.00721.92
8.3.40.0090.00618.76
8.3.30.0090.00618.84
8.3.20.0090.00020.20
8.3.10.0140.00021.89
8.3.00.0030.00520.87
8.2.300.0130.01022.25
8.2.290.0110.00620.43
8.2.280.0080.01018.42
8.2.270.0040.00418.83
8.2.260.0060.01216.88
8.2.250.0040.00418.17
8.2.240.0060.00917.10
8.2.230.0040.00420.94
8.2.220.0060.00324.06
8.2.210.0050.00326.77
8.2.200.0030.00618.41
8.2.190.0130.00316.88
8.2.180.0090.00625.92
8.2.170.0120.00319.07
8.2.160.0100.01022.96
8.2.150.0050.00325.66
8.2.140.0090.00924.66
8.2.130.0030.00522.31
8.2.120.0000.00826.35
8.2.110.0030.00620.93
8.2.100.0120.00018.03
8.2.90.0040.00419.08
8.2.80.0000.00817.97
8.2.70.0000.00817.63
8.2.60.0080.00018.05
8.2.50.0080.00018.10
8.2.40.0000.00820.59
8.2.30.0050.00220.70
8.2.20.0060.00317.62
8.2.10.0060.00318.11
8.2.00.0080.00018.18
8.1.340.0110.00917.63
8.1.330.0060.01222.00
8.1.320.0040.00416.18
8.1.310.0120.00618.38
8.1.300.0120.00318.29
8.1.290.0090.00030.84
8.1.280.0140.00725.92
8.1.270.0080.00023.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00721.30
8.1.230.0060.00619.16
8.1.220.0080.00017.79
8.1.210.0040.00418.77
8.1.200.0080.00017.35
8.1.190.0040.00417.38
8.1.180.0060.00318.10
8.1.170.0040.00418.66
8.1.160.0000.00720.78
8.1.150.0080.00018.80
8.1.140.0000.00719.58
8.1.130.0030.00317.47
8.1.120.0000.00717.29
8.1.110.0030.00517.40
8.1.100.0040.00417.43
8.1.90.0000.00717.43
8.1.80.0040.00417.38
8.1.70.0070.00017.38
8.1.60.0000.00817.61
8.1.50.0000.00817.54
8.1.40.0040.00417.56
8.1.30.0060.00317.64
8.1.20.0060.00317.65
8.1.10.0000.00817.58
8.1.00.0030.00517.52
8.0.300.0000.00918.77
8.0.290.0070.00016.88
8.0.280.0040.00418.36
8.0.270.0030.00317.17
8.0.260.0080.00017.32
8.0.250.0020.00516.94
8.0.240.0060.00317.05
8.0.230.0000.00717.05
8.0.220.0070.00016.97
8.0.210.0000.00716.86
8.0.200.0060.00016.93
8.0.190.0030.00617.04
8.0.180.0050.00216.88
8.0.170.0050.00317.00
8.0.160.0000.00716.96
8.0.150.0040.00416.95
8.0.140.0040.00416.96
8.0.130.0030.00313.38
8.0.120.0030.00516.84
8.0.110.0040.00416.95
8.0.100.0040.00416.94
8.0.90.0040.00416.88
8.0.80.0030.01316.87
8.0.70.0000.00716.94
8.0.60.0080.00016.80
8.0.50.0040.00416.99
8.0.30.0070.01017.28
8.0.20.0120.00717.40
8.0.10.0000.00716.98
8.0.00.0090.01216.77
7.4.330.0000.00515.08
7.4.320.0030.00316.46
7.4.300.0030.00316.49
7.4.290.0000.00716.66
7.4.280.0040.00416.56
7.4.270.0000.00816.52
7.4.260.0040.00416.59
7.4.250.0000.00816.41
7.4.240.0000.00716.53
7.4.230.0040.00416.62
7.4.220.0050.01016.62
7.4.210.0080.00916.57
7.4.200.0030.00316.63
7.4.160.0060.01016.40
7.4.150.0050.01117.40
7.4.140.0100.00717.86
7.4.130.0050.01416.60
7.4.120.0130.00516.35
7.4.110.0110.00716.52
7.4.100.0190.00316.50
7.4.90.0070.01516.77
7.4.80.0100.00919.39
7.4.70.0090.00916.51
7.4.60.0030.01216.61
7.4.50.0090.00916.27
7.4.40.0170.00316.60
7.4.30.0060.01516.23
7.4.00.0060.00914.66
7.3.330.0000.00513.27
7.3.320.0020.00313.28
7.3.310.0030.00316.22
7.3.300.0070.00016.33
7.3.290.0030.00316.23
7.3.280.0060.00916.29
7.3.270.0160.00317.40
7.3.260.0090.00916.55
7.3.250.0080.01116.44
7.3.240.0070.01016.29
7.3.230.0080.00916.45
7.3.210.0130.00416.41
7.3.200.0030.01316.37
7.3.190.0030.01416.46
7.3.180.0070.00816.52
7.3.170.0040.01216.35
7.3.160.0100.00716.43
7.3.120.0110.00414.81
7.3.110.0100.00614.75
7.3.100.0000.01314.68
7.3.90.0120.00314.82
7.3.80.0030.00714.80
7.3.70.0070.00714.84
7.3.60.0110.00414.42
7.3.50.0070.00714.54
7.3.40.0110.00414.60
7.3.30.0030.00714.80
7.3.20.0040.01216.68
7.3.10.0070.00716.39
7.3.00.0070.01016.63
7.2.330.0130.00316.70
7.2.320.0030.01616.58
7.2.310.0040.01416.37
7.2.300.0060.01016.24
7.2.290.0060.01616.39
7.2.240.0040.01515.16
7.2.230.0110.00414.75
7.2.220.0060.00315.03
7.2.210.0030.01214.90
7.2.200.0040.01115.12
7.2.190.0040.01214.70
7.2.180.0030.00514.88
7.2.170.0000.01114.99
7.2.160.0060.00914.61
7.2.150.0060.00616.80
7.2.140.0060.00916.85
7.2.130.0060.01016.93
7.2.120.0070.00716.36
7.2.110.0070.00716.46
7.2.100.0100.00316.50
7.2.90.0000.01416.79
7.2.80.0070.00716.85
7.2.70.0090.00616.73
7.2.60.0060.00816.71
7.2.50.0040.01216.38
7.2.40.0000.01116.58
7.2.30.0000.01416.91
7.2.20.0040.01116.82
7.2.10.0060.00616.97
7.2.00.0080.00817.87
7.1.330.0030.01015.65
7.1.320.0030.01215.48
7.1.310.0080.00615.48
7.1.300.0040.00815.51
7.1.290.0090.00615.71
7.1.280.0040.00715.78
7.1.270.0030.00715.71
7.1.260.0070.00315.64
7.1.250.0030.00615.61
7.1.200.0040.00715.81
7.1.100.0030.00617.86
7.1.70.0090.00617.11
7.1.60.0160.00720.41
7.1.50.0860.01416.97
7.1.00.0030.07322.37
7.0.200.0030.00716.00
7.0.60.0100.07721.72
7.0.50.0200.06717.86
7.0.40.0130.06320.27
7.0.30.0400.05720.10
7.0.20.0370.06720.32
7.0.10.0470.05320.30
7.0.00.0430.05320.21
5.6.280.0100.06721.10
5.6.210.0100.07320.70
5.6.200.0030.05318.18
5.6.190.0100.06720.45
5.6.180.0470.05320.44
5.6.170.0470.04720.49
5.6.160.0300.07720.61
5.6.150.0100.06320.33
5.6.140.0230.06020.59
5.6.130.0130.06320.41
5.6.120.0100.06020.27
5.6.110.0100.06020.20
5.6.100.0170.05320.32
5.6.90.0130.06320.37
5.6.80.0170.05719.82
5.6.70.0170.06019.73
5.6.60.0100.06019.79
5.6.50.0170.05019.59
5.6.40.0200.05019.68
5.6.30.0130.07019.79
5.6.20.0270.04719.81
5.6.10.0200.05719.78
5.6.00.0130.05319.65
5.5.350.4230.04020.47
5.5.340.0030.06317.98
5.5.330.0200.05020.28
5.5.320.0400.05320.24
5.5.310.0570.03720.27
5.5.300.0100.07320.23
5.5.290.0200.05720.21
5.5.280.0030.06720.15
5.5.270.0230.06020.16
5.5.260.0130.06020.18
5.5.250.0270.07019.88
5.5.240.0200.05319.55
5.5.230.0200.05319.53
5.5.220.0070.07019.53
5.5.210.0130.06019.54
5.5.200.0200.04719.48
5.5.190.0200.05719.50
5.5.180.0200.04719.36
5.5.160.0100.05319.35
5.5.150.0230.04719.59
5.5.140.0130.05319.58
5.5.130.0170.05319.50
5.5.120.0130.06719.55
5.5.110.0130.05319.55
5.5.100.0230.04719.26
5.5.90.0100.06319.42
5.5.80.0100.05719.48
5.5.70.0070.06719.41
5.5.60.0170.05319.63
5.5.50.0170.05719.41
5.5.40.0130.05719.46
5.5.30.0100.06019.38
5.5.20.0130.05719.36
5.5.10.0100.06019.52
5.5.00.0100.06319.46

preferences:
47.34 ms | 1824 KiB | 5 Q