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 ($passedVar) extends Test { public $holder; public $publicVar; public function __construct($classArg) { parent::__construct(); $this->holder = $classArg; } public function multiplyByNo($multiplier) { return $this->holder * $multiplier; } }; $templateFunction = function ($someNumber) { return $this->multiplyByNo($someNumber); }; var_dump($x->call($templateFunction, 10));

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.0100.01018.27
8.3.50.0120.00721.11
8.3.40.0140.00718.96
8.3.30.0150.00418.84
8.3.20.0040.00420.16
8.3.10.0040.00423.66
8.3.00.0040.00423.28
8.2.180.0130.00316.50
8.2.170.0150.00022.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0050.00319.66
8.2.120.0080.00026.35
8.2.110.0060.00322.13
8.2.100.0060.00617.80
8.2.90.0040.00419.22
8.2.80.0000.00818.01
8.2.70.0100.00017.75
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0040.00422.23
8.2.30.0050.00319.45
8.2.20.0000.00817.82
8.2.10.0000.00817.95
8.2.00.0040.00418.13
8.1.280.0070.00725.92
8.1.270.0000.00920.33
8.1.260.0090.00028.09
8.1.250.0070.00028.09
8.1.240.0030.00623.93
8.1.230.0110.00019.16
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0070.00018.10
8.1.170.0000.00818.51
8.1.160.0040.00420.76
8.1.150.0040.00418.82
8.1.140.0000.00819.50
8.1.130.0030.00317.66
8.1.120.0000.00717.37
8.1.110.0070.00017.52
8.1.100.0050.00217.38
8.1.90.0000.00817.40
8.1.80.0080.00017.36
8.1.70.0000.00817.42
8.1.60.0060.00317.58
8.1.50.0040.00417.39
8.1.40.0040.00417.57
8.1.30.0000.00817.73
8.1.20.0000.00717.49
8.1.10.0050.00217.65
8.1.00.0040.00417.52
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0000.00718.48
8.0.270.0030.00317.31
8.0.260.0000.00617.20
8.0.250.0000.00717.06
8.0.240.0000.00817.00
8.0.230.0030.00316.90
8.0.220.0000.00716.99
8.0.210.0070.00016.99
8.0.200.0030.00316.88
8.0.190.0060.00317.08
8.0.180.0050.00316.96
8.0.170.0060.00316.90
8.0.160.0040.00417.04
8.0.150.0040.00416.78
8.0.140.0070.00016.86
8.0.130.0000.00613.38
8.0.120.0080.00016.77
8.0.110.0070.00016.80
8.0.100.0070.00017.01
8.0.90.0000.00716.91
8.0.80.0060.00916.92
8.0.70.0000.00716.91
8.0.60.0000.00716.83
8.0.50.0040.00416.81
8.0.30.0090.00917.06
8.0.20.0100.00917.40
8.0.10.0000.00717.13
8.0.00.0070.01316.79
7.4.330.0000.00516.79
7.4.320.0030.00316.63
7.4.300.0000.00716.63
7.4.290.0080.00016.61
7.4.280.0000.00816.50
7.4.270.0070.00016.52
7.4.260.0000.01116.56
7.4.250.0070.00016.57
7.4.240.0030.00416.56
7.4.230.0030.00316.67
7.4.220.0060.00916.64
7.4.210.0040.01216.56
7.4.200.0030.00316.45
7.4.160.0030.01216.57
7.4.150.0170.00017.40
7.4.140.0130.01017.86
7.4.130.0140.00316.61
7.4.120.0120.00616.60
7.4.110.0140.00416.69
7.4.100.0080.01016.55
7.4.90.0170.00016.61
7.4.80.0120.00919.39
7.4.70.0040.01716.55
7.4.60.0080.00816.41
7.4.50.0070.00716.35
7.4.40.0110.00716.49
7.4.30.0100.00716.39
7.4.00.0070.00915.05
7.3.330.0060.00013.33
7.3.320.0030.00313.30
7.3.310.0000.00716.45
7.3.300.0060.00016.26
7.3.290.0050.01316.38
7.3.280.0070.00916.35
7.3.270.0060.01217.40
7.3.260.0070.01016.45
7.3.240.0050.01216.37
7.3.230.0070.01016.39
7.3.210.0200.00316.36
7.3.200.0080.00819.39
7.3.190.0150.00616.57
7.3.180.0160.00316.49
7.3.170.0150.00816.50
7.3.160.0090.01216.53
7.3.120.0000.02114.80
7.3.110.0160.00314.53
7.3.100.0040.01114.98
7.3.90.0030.01014.73
7.3.80.0130.00014.66
7.3.70.0040.00714.61
7.3.60.0030.01014.66
7.3.50.0100.00315.02
7.3.40.0080.00414.88
7.3.30.0000.01114.82
7.3.20.0030.00816.82
7.3.10.0080.00416.70
7.3.00.0070.00716.66
7.2.330.0110.00716.62
7.2.320.0120.00616.70
7.2.310.0000.01616.58
7.2.300.0070.01116.41
7.2.290.0100.00716.84
7.2.250.0060.01315.25
7.2.240.0070.01114.68
7.2.230.0030.01314.96
7.2.220.0060.00614.78
7.2.210.0060.00914.89
7.2.200.0070.01015.14
7.2.190.0060.00615.04
7.2.180.0030.01215.02
7.2.170.0000.01714.95
7.2.60.0030.01316.68
7.2.00.0030.01019.16
7.1.330.0040.01115.64
7.1.320.0030.00915.93
7.1.310.0120.00315.85
7.1.300.0040.00815.71
7.1.290.0070.00715.57
7.1.280.0100.00315.96
7.1.270.0030.00915.82
7.1.260.0040.00715.73
7.1.200.0090.00615.74
7.1.100.0040.00718.18
7.1.70.0000.00817.24
7.1.60.0000.02519.27
7.1.50.0070.01016.73
7.1.00.0070.07322.43
7.0.200.0080.00016.38
7.0.60.0200.03721.73
7.0.50.0030.04317.88
7.0.40.0200.05020.18
7.0.30.0300.07720.33
7.0.20.0370.07020.23
7.0.10.0070.07720.15
7.0.00.0170.06720.19
5.6.280.0030.03020.89
5.6.210.0030.04320.48
5.6.200.0070.08018.19
5.6.190.0070.04720.41
5.6.180.0370.05720.64
5.6.170.0270.07720.55
5.6.160.0100.08020.52
5.6.150.0100.06318.12
5.6.140.0100.08018.18
5.6.130.0070.03718.14
5.6.120.0100.04021.03
5.6.110.0070.07020.99
5.6.100.0000.04720.96
5.6.90.0100.07720.97
5.6.80.0070.04020.47
5.5.350.0030.08320.47
5.5.340.0130.07718.04
5.5.330.0030.04020.40
5.5.320.0700.06020.38
5.5.310.0270.06320.34
5.5.300.0070.05318.03
5.5.290.0070.08017.92
5.5.280.0100.05320.81
5.5.270.0070.08720.89
5.5.260.0070.07020.80
5.5.250.0070.03720.63
5.5.240.0130.03020.28

preferences:
54.7 ms | 401 KiB | 5 Q