3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $protectedVariable; public function __construct() { $this->protectedVariable = 'this belongs to test class'; } } $x = new class (5) extends Test { public $holder; public $publicVar; public function __construct($classArg) { parent::__construct(); $this->holder = $classArg; } public function multiplyByNo($multiplier) { return $this->holder * $multiplier; } public function getParentVar() { $this->publicVar = $this->protectedVariable; return $this->protectedVariable; } }; var_dump($x->multiplyByNo(10)); var_dump($x->getParentVar()); var_dump($x);

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.0180.00016.50
8.3.50.0110.01521.11
8.3.40.0090.00618.66
8.3.30.0100.00718.65
8.3.20.0040.00420.30
8.3.10.0040.00421.82
8.3.00.0070.00023.48
8.2.180.0120.00618.41
8.2.170.0110.00422.96
8.2.160.0070.01120.45
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00419.53
8.2.120.0000.00826.35
8.2.110.0050.00522.31
8.2.100.0080.00418.05
8.2.90.0030.00519.40
8.2.80.0030.00517.97
8.2.70.0030.00617.50
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0030.00722.32
8.2.30.0000.00719.32
8.2.20.0040.00417.60
8.2.10.0000.00717.95
8.2.00.0040.00418.13
8.1.280.0140.00725.92
8.1.270.0040.01120.22
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0040.00720.77
8.1.230.0040.00719.08
8.1.220.0080.00017.74
8.1.210.0000.00918.77
8.1.200.0030.00617.35
8.1.190.0030.00617.35
8.1.180.0000.00818.10
8.1.170.0060.00318.66
8.1.160.0040.00420.78
8.1.150.0070.00018.91
8.1.140.0000.00819.46
8.1.130.0030.00317.66
8.1.120.0070.00017.51
8.1.110.0070.00017.46
8.1.100.0040.00417.46
8.1.90.0000.00717.51
8.1.80.0030.00617.37
8.1.70.0030.00317.44
8.1.60.0000.00817.56
8.1.50.0000.00817.59
8.1.40.0040.00417.53
8.1.30.0080.00017.52
8.1.20.0050.00217.57
8.1.10.0080.00017.53
8.1.00.0040.00417.41
8.0.300.0060.00318.77
8.0.290.0020.00516.63
8.0.280.0000.00718.45
8.0.270.0000.00717.34
8.0.260.0030.00317.28
8.0.250.0030.00316.96
8.0.240.0030.00316.91
8.0.230.0050.00316.93
8.0.220.0030.00316.89
8.0.210.0040.00416.82
8.0.200.0030.00316.93
8.0.190.0000.00916.99
8.0.180.0040.00416.82
8.0.170.0030.00516.96
8.0.160.0000.00716.80
8.0.150.0000.00716.79
8.0.140.0000.00816.74
8.0.130.0050.00013.34
8.0.120.0030.00616.88
8.0.110.0040.00416.93
8.0.100.0040.00416.87
8.0.90.0030.00616.94
8.0.80.0110.00616.88
8.0.70.0000.00816.79
8.0.60.0030.00616.82
8.0.50.0040.00416.86
8.0.30.0100.01116.99
8.0.20.0140.00517.40
8.0.10.0040.00417.02
8.0.00.0140.00616.69
7.4.330.0030.00316.83
7.4.320.0040.00416.60
7.4.300.0000.00816.50
7.4.290.0000.00716.51
7.4.280.0030.00616.52
7.4.270.0000.00716.60
7.4.260.0090.00016.51
7.4.250.0030.00516.49
7.4.240.0060.00116.55
7.4.230.0000.00816.41
7.4.220.0070.01316.62
7.4.210.0150.00416.64
7.4.200.0070.00016.32
7.4.160.0120.00916.45
7.4.150.0180.00017.40
7.4.140.0100.00717.86
7.4.130.0110.00916.56
7.4.120.0130.00516.67
7.4.110.0080.01116.57
7.4.100.0120.00616.43
7.4.90.0070.01416.43
7.4.80.0090.00919.39
7.4.70.0110.00716.46
7.4.60.0100.00616.56
7.4.50.0120.00316.63
7.4.40.0110.00616.48
7.4.30.0110.00616.71
7.4.00.0070.01114.97
7.3.330.0000.00513.13
7.3.320.0030.00713.31
7.3.310.0070.00016.11
7.3.300.0000.00616.31
7.3.290.0090.00516.29
7.3.280.0070.01216.31
7.3.270.0170.00017.40
7.3.260.0080.00916.45
7.3.250.0090.01216.46
7.3.240.0110.00916.50
7.3.230.0090.00916.57
7.3.210.0100.00716.53
7.3.200.0080.01119.39
7.3.190.0110.00716.27
7.3.180.0080.00816.29
7.3.170.0040.01216.44
7.3.160.0110.01116.42
7.3.10.0090.00616.67
7.3.00.0070.00716.75
7.2.330.0180.00716.66
7.2.320.0140.00416.69
7.2.310.0030.02016.77
7.2.300.0080.00816.42
7.2.290.0030.01316.68
7.2.130.0060.00917.03
7.2.120.0110.00717.07
7.2.110.0060.00917.11
7.2.100.0090.00616.98
7.2.90.0040.01117.08
7.2.80.0040.00816.92
7.2.70.0040.00816.72
7.2.60.0020.01317.05
7.2.50.0030.01017.16
7.2.40.0060.00617.10
7.2.30.0030.01317.06
7.2.20.0070.00416.92
7.2.10.0030.01316.70
7.2.00.0060.00916.97
7.1.250.0040.00715.95
7.1.200.0000.01315.81
7.1.70.0030.00717.03
7.1.60.0110.01419.27
7.1.50.0030.01316.92
7.1.00.0030.07722.33
7.0.200.0000.01016.74
7.0.100.0330.07019.93
7.0.90.0300.06719.90
7.0.80.0300.08019.99
7.0.70.0300.07719.89
7.0.60.0300.07319.94
7.0.50.0230.08720.17
7.0.40.0070.08720.03
7.0.30.0070.07320.09
7.0.20.0070.07020.00
7.0.10.0100.08020.03
7.0.00.0100.08720.04
5.6.280.0030.03321.04
5.6.250.0100.07720.63
5.6.240.0130.07720.68
5.6.230.0000.04720.59
5.6.220.0100.08320.63
5.6.210.0070.08320.49
5.6.200.0200.06321.03
5.6.190.0030.09720.94
5.6.180.0130.08721.04
5.6.170.0070.05021.05
5.6.160.0000.05021.00
5.6.150.0070.08021.02
5.6.140.0030.06720.96
5.6.130.0130.07321.08
5.6.120.0030.08721.08
5.6.110.0100.08721.02
5.6.100.0130.08021.12
5.6.90.0130.08320.89
5.6.80.0070.08020.34
5.6.70.0070.07720.43
5.6.60.0030.08020.45
5.6.50.0000.05720.49
5.6.40.0030.06020.38
5.6.30.0100.05320.32
5.6.20.0070.03720.41
5.6.10.0100.08020.36
5.6.00.0000.09320.34
5.5.380.0070.04720.55
5.5.370.0100.07020.37
5.5.360.0170.07020.51
5.5.350.0070.07320.40
5.5.340.0200.07020.89
5.5.330.0100.07020.87
5.5.320.0070.08720.88
5.5.310.0070.08020.83
5.5.300.0100.06020.92
5.5.290.0230.06720.88
5.5.280.0070.08720.75
5.5.270.0030.08720.82
5.5.260.0170.07720.75
5.5.250.0130.07320.57
5.5.240.0030.08320.25
5.5.230.0100.08720.14
5.5.220.0030.08720.27
5.5.210.0070.08020.21
5.5.200.0130.07320.25
5.5.190.0100.08320.15
5.5.180.0070.04320.18
5.5.160.0070.07720.22
5.5.150.0070.07720.15
5.5.140.0070.07320.26
5.5.130.0100.05320.23
5.5.120.0030.07320.26
5.5.110.0070.04320.27
5.5.100.0130.07719.98
5.5.90.0070.07019.97
5.5.80.0130.07320.06
5.5.70.0030.08020.09
5.5.60.0000.08020.09
5.5.50.0070.08720.05
5.5.40.0000.07320.13
5.5.30.0100.06320.11
5.5.20.0130.06020.15
5.5.10.0070.04720.04
5.5.00.0170.07019.97

preferences:
61.33 ms | 401 KiB | 5 Q