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) { var_dump($callback); return $callback(5); } $x = showCase(new class ($passedVar) 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.0140.00416.88
8.3.50.0090.00921.21
8.3.40.0120.00318.97
8.3.30.0130.00318.79
8.3.20.0080.00020.28
8.3.10.0040.00421.93
8.3.00.0070.00023.61
8.2.180.0130.01016.50
8.2.170.0140.00022.96
8.2.160.0030.01320.28
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00219.83
8.2.120.0080.00026.35
8.2.110.0030.00622.08
8.2.100.0060.00617.93
8.2.90.0050.00319.09
8.2.80.0050.00317.97
8.2.70.0090.00017.63
8.2.60.0000.00817.93
8.2.50.0080.00018.07
8.2.40.0070.00322.36
8.2.30.0040.00419.46
8.2.20.0040.00417.75
8.2.10.0070.00017.94
8.2.00.0050.00318.14
8.1.280.0090.00925.92
8.1.270.0190.00020.24
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0080.00320.86
8.1.230.0070.00319.10
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.00917.35
8.1.190.0060.00317.35
8.1.180.0000.00718.10
8.1.170.0060.00318.63
8.1.160.0050.00220.79
8.1.150.0070.00018.82
8.1.140.0030.00519.52
8.1.130.0000.00717.63
8.1.120.0040.00417.45
8.1.110.0040.00317.48
8.1.100.0070.00017.41
8.1.90.0000.00817.52
8.1.80.0040.00417.39
8.1.70.0000.00717.46
8.1.60.0040.00417.49
8.1.50.0000.00817.62
8.1.40.0000.00817.58
8.1.30.0040.00417.52
8.1.20.0000.00817.66
8.1.10.0000.00717.63
8.1.00.0060.00317.60
8.0.300.0000.00718.77
8.0.290.0080.00016.75
8.0.280.0030.00318.41
8.0.270.0030.00317.19
8.0.260.0000.00617.29
8.0.250.0060.00016.98
8.0.240.0000.00717.04
8.0.230.0000.00716.93
8.0.220.0030.00616.91
8.0.210.0040.00416.91
8.0.200.0040.00416.93
8.0.190.0050.00317.01
8.0.180.0030.00316.90
8.0.170.0080.00016.94
8.0.160.0040.00416.99
8.0.150.0000.00716.92
8.0.140.0070.00016.78
8.0.130.0030.00313.38
8.0.120.0050.00316.84
8.0.110.0000.00717.04
8.0.100.0040.00416.99
8.0.90.0040.00416.97
8.0.80.0110.00616.91
8.0.70.0040.00417.00
8.0.60.0050.00316.95
8.0.50.0000.00717.09
8.0.30.0090.00717.10
8.0.20.0080.01217.40
8.0.10.0020.00517.09
8.0.00.0150.00716.92
7.4.330.0020.00216.67
7.4.320.0000.00716.53
7.4.300.0080.00016.64
7.4.290.0000.00716.53
7.4.280.0050.00316.54
7.4.270.0040.00416.44
7.4.260.0030.00316.42
7.4.250.0020.00516.52
7.4.240.0020.00616.53
7.4.230.0050.00216.32
7.4.220.0120.00916.58
7.4.210.0070.01416.61
7.4.200.0030.00316.63
7.4.160.0060.00916.50
7.4.150.0110.00617.40
7.4.140.0150.00717.86
7.4.130.0120.00616.60
7.4.120.0120.00616.39
7.4.110.0090.00916.55
7.4.100.0100.00716.56
7.4.90.0140.00316.44
7.4.80.0130.00719.39
7.4.70.0090.00916.61
7.4.60.0080.00816.60
7.4.50.0000.01616.41
7.4.40.0130.00616.60
7.4.30.0090.00916.50
7.4.00.0000.01015.10
7.3.330.0030.00313.39
7.3.320.0060.00013.20
7.3.310.0040.00416.36
7.3.300.0040.00416.34
7.3.290.0050.01116.33
7.3.280.0100.00816.39
7.3.270.0130.00317.40
7.3.260.0130.00316.54
7.3.240.0110.00816.40
7.3.230.0110.00716.59
7.3.210.0040.01416.49
7.3.200.0210.00019.39
7.3.190.0150.00316.48
7.3.180.0080.00816.44
7.3.170.0080.00816.50
7.3.160.0060.01216.60
7.3.120.0040.01414.51
7.3.110.0070.01114.90
7.3.100.0060.00914.94
7.3.90.0170.00014.88
7.3.80.0040.01114.84
7.3.70.0070.00714.83
7.3.60.0040.01414.84
7.3.50.0090.00314.53
7.3.40.0030.00814.66
7.3.30.0070.00414.89
7.3.20.0060.00316.72
7.3.10.0040.01116.45
7.3.00.0030.00616.68
7.2.330.0110.00716.39
7.2.320.0090.00916.63
7.2.310.0100.00716.46
7.2.300.0130.00316.60
7.2.290.0000.02016.61
7.2.240.0070.01015.20
7.2.230.0000.01614.83
7.2.220.0100.01015.08
7.2.210.0100.00315.10
7.2.200.0070.00714.85
7.2.190.0030.01015.02
7.2.180.0070.01014.88
7.2.170.0070.01114.74
7.2.160.0060.01014.99
7.2.150.0040.01217.04
7.2.140.0030.00916.75
7.2.130.0000.00917.00
7.2.120.0070.01016.97
7.2.110.0000.01416.93
7.2.100.0070.00716.57
7.2.90.0090.00016.59
7.2.80.0050.00516.89
7.2.70.0070.00416.77
7.2.60.0070.00316.72
7.2.50.0040.00916.83
7.2.40.0040.01216.93
7.2.30.0060.01016.61
7.2.20.0070.00416.78
7.2.10.0000.01416.90
7.2.00.0000.01616.89
7.1.330.0060.00915.87
7.1.320.0060.00915.98
7.1.310.0000.01315.79
7.1.300.0000.01215.74
7.1.290.0060.00615.91
7.1.280.0140.00015.82
7.1.270.0080.00815.86
7.1.260.0030.00915.98
7.1.250.0130.00315.98
7.1.200.0040.00715.69
7.1.70.0030.00517.13
7.1.60.0160.00919.27
7.1.50.0100.01316.69
7.1.00.0030.07722.42
7.0.200.0000.00916.39
7.0.60.0130.04321.72
7.0.50.0070.07317.89
7.0.40.0200.07720.13
7.0.30.0300.05320.30
7.0.20.0400.07020.09
7.0.10.0070.07320.16
7.0.00.0030.07020.15
5.6.280.0070.06721.16
5.6.210.0170.06720.47
5.6.200.0070.07018.14
5.6.190.0130.03720.64
5.6.180.0470.07320.39
5.6.170.0300.06020.39
5.6.160.0000.09020.39
5.6.150.0100.06718.15
5.6.140.0030.07318.27
5.6.130.0100.03318.14
5.6.120.0000.05021.15
5.6.110.0030.09021.15
5.6.100.0100.05320.99
5.6.90.0000.07321.11
5.6.80.0070.03720.38
5.5.350.0000.08020.45
5.5.340.0070.08017.95
5.5.330.0070.04020.21
5.5.320.0570.07020.31
5.5.310.0300.07020.41
5.5.300.0000.04318.09
5.5.290.0070.07318.07
5.5.280.0030.06320.85
5.5.270.0100.08320.89
5.5.260.0170.07320.68
5.5.250.0030.04020.71
5.5.240.0130.04020.24

preferences:
33.82 ms | 401 KiB | 5 Q