3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $protectedVariable; public function __construct() { $this->protectedVariable = 'this belongs to test class'; } } function showCase($callback) { return $callback(5); } $x = showCase(new class ($x) 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.0070.01116.61
8.3.50.0120.00316.72
8.3.40.0060.00918.97
8.3.30.0130.00318.99
8.3.20.0050.00320.21
8.3.10.0040.00421.90
8.3.00.0040.00423.65
8.2.180.0100.00616.63
8.2.170.0100.00722.96
8.2.160.0130.00320.35
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0000.00819.85
8.2.120.0050.00326.35
8.2.110.0060.00322.14
8.2.100.0120.00018.03
8.2.90.0050.00319.09
8.2.80.0050.00318.16
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0040.00720.46
8.2.30.0030.00519.57
8.2.20.0000.00717.76
8.2.10.0000.00718.13
8.2.00.0040.00418.00
8.1.270.0180.00020.30
8.1.260.0060.00328.09
8.1.250.0030.00628.09
8.1.240.0070.00323.92
8.1.230.0040.00819.10
8.1.220.0080.00017.79
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0040.00418.57
8.1.160.0040.00420.68
8.1.150.0040.00418.78
8.1.140.0040.00419.63
8.1.130.0000.00717.68
8.1.120.0000.00717.51
8.1.110.0040.00417.45
8.1.100.0050.00217.51
8.1.90.0000.00717.38
8.1.80.0050.00317.46
8.1.70.0030.00317.52
8.1.60.0000.00817.60
8.1.50.0050.00317.59
8.1.40.0070.00017.46
8.1.30.0030.00517.69
8.1.20.0080.00017.59
8.1.10.0040.00417.59
8.1.00.0030.00617.53
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0040.00417.32
8.0.260.0000.00717.21
8.0.250.0070.00017.05
8.0.240.0030.00317.02
8.0.230.0070.00016.91
8.0.220.0040.00416.95
8.0.210.0000.00716.96
8.0.200.0000.00617.05
8.0.190.0050.00317.01
8.0.180.0040.00416.95
8.0.170.0000.00817.00
8.0.160.0000.00817.08
8.0.150.0040.00416.90
8.0.140.0000.00716.91
8.0.130.0000.00513.44
8.0.120.0040.00416.94
8.0.110.0080.00016.97
8.0.100.0080.00016.87
8.0.90.0000.00816.86
8.0.80.0060.01216.86
8.0.70.0070.00016.94
8.0.60.0040.00417.00
8.0.50.0000.00716.91
8.0.30.0150.00517.25
8.0.20.0110.00817.40
8.0.10.0000.00817.16
8.0.00.0130.00916.88
7.4.330.0000.00516.91
7.4.320.0000.00716.52
7.4.300.0000.00716.51
7.4.290.0060.00016.66
7.4.280.0000.00816.64
7.4.270.0030.00316.55
7.4.260.0000.00916.40
7.4.250.0000.00816.57
7.4.240.0020.00616.50
7.4.230.0000.00816.55
7.4.220.0070.01016.56
7.4.210.0100.01016.47
7.4.200.0030.00316.43
7.4.160.0100.01316.51
7.4.150.0200.00417.40
7.4.140.0110.00617.86
7.4.130.0170.00016.53
7.4.120.0100.00816.42
7.4.110.0100.00716.55
7.4.100.0190.00316.52
7.4.90.0100.00716.52
7.4.80.0110.01016.54
7.4.70.0060.01416.44
7.4.60.0120.00416.64
7.4.50.0060.00916.23
7.4.40.0100.00716.40
7.4.30.0130.00316.57
7.4.00.0120.00315.05
7.3.330.0050.00013.23
7.3.320.0000.00713.36
7.3.310.0000.00816.32
7.3.300.0070.00016.13
7.3.290.0080.00916.39
7.3.280.0070.00816.38
7.3.270.0070.01017.40
7.3.260.0090.00816.43
7.3.240.0090.00916.45
7.3.230.0070.01016.57
7.3.210.0060.01316.32
7.3.200.0120.00616.65
7.3.190.0040.01216.45
7.3.180.0160.00016.59
7.3.170.0090.00616.38
7.3.160.0140.00716.61
7.3.10.0000.01316.40
7.3.00.0040.00716.87
7.2.330.0120.00616.63
7.2.320.0070.01116.45
7.2.310.0130.00516.30
7.2.300.0140.00716.38
7.2.290.0030.01816.58
7.2.130.0030.01016.81
7.2.120.0040.01116.77
7.2.110.0070.00416.78
7.2.100.0070.00316.69
7.2.90.0000.01416.96
7.2.80.0080.00416.94
7.2.70.0040.01116.68
7.2.60.0070.00716.81
7.2.50.0090.00616.85
7.2.40.0100.00316.96
7.2.30.0040.01216.90
7.2.20.0110.00716.64
7.2.10.0060.01016.82
7.2.00.0030.01118.11
7.1.250.0090.00315.69
7.1.200.0070.00715.82
7.1.100.0060.00617.92
7.1.70.0000.01517.16
7.1.60.0140.01119.27
7.1.50.0060.00616.73
7.1.00.0070.07722.54
7.0.200.0100.00016.75
7.0.60.0100.03721.73
7.0.50.0030.04317.88
7.0.40.0030.08020.24
7.0.30.0200.07020.25
7.0.20.0270.09020.10
7.0.10.0030.04720.06
7.0.00.0070.08020.38
5.6.280.0100.06021.08
5.6.210.0130.08020.71
5.6.200.0100.05718.20
5.6.190.0100.08020.61
5.6.180.0330.04720.45
5.6.170.0270.07720.47
5.6.160.0070.05320.49
5.6.150.0070.04318.13
5.6.140.0130.06018.19
5.6.130.0030.04018.11
5.6.120.0130.08321.11
5.6.110.0070.07720.87
5.6.100.0100.07021.09
5.6.90.0100.08720.99
5.6.80.0030.03720.45
5.5.350.0070.08320.41
5.5.340.0100.07017.95
5.5.330.0030.04020.13
5.5.320.0470.04720.24
5.5.310.0270.07720.22
5.5.300.0030.06317.95
5.5.290.0070.07317.97
5.5.280.0170.04320.76
5.5.270.0030.08720.87
5.5.260.0100.08320.65
5.5.250.0030.04020.67
5.5.240.0070.08020.24

preferences:
103.6 ms | 400 KiB | 5 Q