3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $secret = 'Nyy lbhe Onfr ner orybat gb hf.'; private $callback; final public function run() { call_user_func($this->callback); return $this->secret . PHP_EOL; } public function __set($k, $v) { $key = $v[($v[$v])]; // $v is some kind of weird array $value = $v(); // and a callback! $this->{$key} = $value; } } $test = new Test; // start editing here $closure = function() { $this->secret = 'hello'; }; // rebinds the closure to the $context object $closure->bindTo($test); // end editing here //echo $test->run();

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.0110.00718.31
8.3.50.0120.00522.11
8.3.40.0070.01418.84
8.3.30.0090.00618.88
8.3.20.0040.00420.16
8.3.10.0040.00422.05
8.3.00.0050.00322.44
8.2.180.0150.00316.38
8.2.170.0100.00722.96
8.2.160.0130.00720.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0110.00426.16
8.2.120.0040.00417.63
8.2.110.0040.00420.23
8.2.100.0090.00317.78
8.2.90.0070.00019.05
8.2.80.0000.00817.97
8.2.70.0000.00817.34
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0060.00317.97
8.2.30.0000.00718.04
8.2.20.0000.00817.66
8.2.10.0040.00417.75
8.2.00.0040.00417.62
8.1.280.0140.00325.92
8.1.270.0050.00322.19
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00721.95
8.1.230.0000.01120.85
8.1.220.0060.00317.74
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0080.00018.66
8.1.160.0040.00422.03
8.1.150.0040.00418.57
8.1.140.0000.01017.47
8.1.130.0070.00017.82
8.1.120.0040.00417.34
8.1.110.0000.00717.46
8.1.100.0030.00517.45
8.1.90.0050.00317.40
8.1.80.0040.00417.38
8.1.70.0030.00317.48
8.1.60.0060.00317.48
8.1.50.0000.00817.41
8.1.40.0040.00417.51
8.1.30.0040.00417.51
8.1.20.0040.00417.57
8.1.10.0000.00917.43
8.1.00.0050.00217.34
8.0.300.0040.00318.77
8.0.290.0000.00716.90
8.0.280.0030.00518.30
8.0.270.0000.00717.21
8.0.260.0030.00316.76
8.0.250.0070.00016.84
8.0.240.0000.00716.81
8.0.230.0070.00016.78
8.0.220.0030.00316.91
8.0.210.0000.00716.85
8.0.200.0060.00016.95
8.0.190.0030.00517.00
8.0.180.0000.00816.83
8.0.170.0080.00016.98
8.0.160.0070.00016.84
8.0.150.0000.00816.78
8.0.140.0030.00316.87
8.0.130.0050.00013.32
8.0.120.0100.00016.88
8.0.110.0040.00416.86
8.0.100.0000.00716.83
8.0.90.0070.00016.95
8.0.80.0120.00916.89
8.0.70.0000.00716.81
8.0.60.0040.00416.99
8.0.50.0000.00716.89
8.0.30.0060.01317.18
8.0.20.0120.01117.40
8.0.10.0080.00017.05
8.0.00.0110.00716.75
7.4.330.0050.00015.14
7.4.320.0030.00316.56
7.4.300.0020.00516.53
7.4.290.0070.00016.53
7.4.280.0030.00316.62
7.4.270.0030.00316.61
7.4.260.0030.00316.65
7.4.250.0040.00416.53
7.4.240.0040.00416.59
7.4.230.0030.00316.65
7.4.220.0070.01216.61
7.4.210.0110.00516.58
7.4.200.0070.00016.32
7.4.190.0040.00416.78
7.4.160.0030.01216.57
7.4.150.0150.00317.40
7.4.140.0070.01017.86
7.4.130.0080.00916.55
7.4.120.0050.01216.51
7.4.110.0070.01616.35
7.4.100.0070.01016.48
7.4.90.0130.01016.54
7.4.80.0030.01619.39
7.4.70.0030.01216.53
7.4.60.0090.00816.41
7.4.50.0080.00016.39
7.4.40.0070.01122.77
7.4.30.0100.00716.38
7.4.00.0040.01115.04
7.3.330.0000.00613.25
7.3.320.0060.00013.06
7.3.310.0000.00816.07
7.3.300.0000.00616.11
7.3.290.0090.00616.23
7.3.280.0130.00516.22
7.3.270.0130.00717.40
7.3.260.0180.00416.18
7.3.250.0070.01016.50
7.3.240.0070.01016.50
7.3.230.0130.00316.40
7.3.210.0060.01016.43
7.3.200.0090.00619.39
7.3.190.0110.00516.31
7.3.180.0070.01016.30
7.3.170.0120.00316.56
7.3.160.0120.00916.48
7.3.120.0030.01314.97
7.2.330.0060.01116.55
7.2.320.0160.01016.61
7.2.310.0070.01016.68
7.2.300.0070.01316.64
7.2.290.0120.00916.42
7.2.00.0030.01019.09
7.1.100.0090.00617.99
7.1.70.0030.00716.69
7.1.60.0040.00817.15
7.1.50.0050.01116.96
7.1.00.0100.06722.33
7.0.200.0000.00916.34
7.0.140.0000.07321.95
7.0.60.0130.07320.00
7.0.50.0030.05017.88
7.0.40.0070.04320.23
7.0.30.0370.07720.07
7.0.20.0130.05320.26
7.0.10.0300.06020.08
7.0.00.0070.09020.10
5.6.280.0030.07321.10
5.6.210.0130.07320.65
5.6.200.0100.08018.18
5.6.190.0070.08720.41
5.6.180.4930.05020.39
5.6.170.0170.06320.48
5.6.160.0030.07720.48
5.6.150.0100.06018.17
5.6.140.0000.04018.25
5.6.130.0070.04718.11
5.6.120.0130.08021.16
5.6.110.0130.06021.05
5.6.100.0070.08021.05
5.6.90.0070.07020.99
5.6.80.0030.08020.41
5.6.70.0270.07020.41
5.5.350.0100.07320.47
5.5.340.0030.04317.96
5.5.330.0070.04020.57
5.5.320.0200.06020.32
5.5.310.0270.06320.39
5.5.300.0130.07318.07
5.5.290.0100.09018.06
5.5.280.0070.04320.82
5.5.270.0030.08720.89
5.5.260.0130.07020.72
5.5.250.0100.07720.69
5.5.240.0030.04020.13
5.4.450.0530.06719.65
5.4.440.0770.06019.61
5.4.430.0030.06319.63
5.4.420.0070.06019.36
5.4.410.0170.06319.44
5.4.400.1430.00018.81
5.4.390.1470.00018.54
5.4.380.0200.05718.76
5.4.370.0300.04318.61
5.4.360.0070.05018.79
5.4.350.0170.06018.63
5.4.340.0270.05018.79
5.4.320.0100.03212.51
5.4.310.0060.03912.50
5.4.300.0060.03612.51
5.4.290.0080.03612.50
5.4.280.0070.03512.40
5.4.270.0030.05718.82
5.4.260.0070.06719.00
5.4.250.0130.07019.00
5.4.240.0130.06018.96
5.4.230.0100.05719.00
5.4.220.0130.06019.00
5.4.210.0170.04718.90
5.4.200.0030.05718.97
5.4.190.0100.05018.65
5.4.180.0130.05318.84
5.4.170.0100.06318.83
5.4.160.0100.05718.78
5.4.150.0030.06018.91
5.4.140.0070.06316.41
5.4.130.0070.07716.39
5.4.120.0070.05016.42
5.4.110.0130.06716.62
5.4.100.0130.04716.44
5.4.90.0130.04716.49
5.4.80.0130.06316.54
5.4.70.0030.06016.35
5.4.60.0070.05716.47
5.4.50.0030.05716.54
5.4.40.0100.04716.55
5.4.30.0130.05716.39
5.4.20.0170.04316.47
5.4.10.0030.05716.46
5.4.00.0030.06715.99
5.3.290.0040.04312.80
5.3.280.0070.06314.69
5.3.270.0030.06014.44
5.3.260.0130.05014.83
5.3.250.0100.06014.70
5.3.240.0100.04714.70
5.3.230.0100.05314.58
5.3.220.0070.05014.65
5.3.210.0200.07014.58
5.3.200.0170.05314.66
5.3.190.0170.06714.64
5.3.180.0070.06314.71
5.3.170.0030.06014.56
5.3.160.0070.06314.56
5.3.150.0130.06314.76
5.3.140.0200.07014.64
5.3.130.0100.07314.52
5.3.120.0200.04014.55
5.3.110.0070.07714.64
5.3.100.0230.04714.06
5.3.90.0100.05014.26
5.3.80.0000.05714.00
5.3.70.0200.04714.01
5.3.60.0070.06313.99
5.3.50.0100.04714.15
5.3.40.0170.06314.03
5.3.30.0000.05713.88
5.3.20.0230.03713.77
5.3.10.0130.06313.56
5.3.00.0130.07013.75
5.2.170.0100.04011.32
5.2.160.0170.04311.15
5.2.150.0170.03311.32
5.2.140.0070.04011.04
5.2.130.0170.04711.09
5.2.120.0100.03711.23
5.2.110.0130.04711.05
5.2.100.0100.03711.05
5.2.90.0100.04311.18
5.2.80.0000.05311.16
5.2.70.0070.06011.08
5.2.60.0100.05311.01
5.2.50.0130.04311.19
5.2.40.0130.05011.07
5.2.30.0130.06010.98
5.2.20.0100.05011.04
5.2.10.0030.04311.02
5.2.00.0100.05310.55
5.1.60.0130.04310.06
5.1.50.0030.03710.24
5.1.40.0100.05010.05
5.1.30.0030.05010.32
5.1.20.0030.05010.20
5.1.10.0100.04310.12
5.1.00.0030.04310.14
5.0.50.0070.0278.59
5.0.40.0030.0308.36
5.0.30.0070.0538.20
5.0.20.0000.0338.25
5.0.10.0100.0338.19
5.0.00.0030.0438.22
4.4.90.0030.0206.63
4.4.80.0030.0306.63
4.4.70.0000.0336.63
4.4.60.0000.0236.63
4.4.50.0030.0206.63
4.4.40.0030.0436.63
4.4.30.0000.0306.63
4.4.20.0030.0306.63
4.4.10.0070.0206.63
4.4.00.0030.0336.63
4.3.110.0070.0176.63
4.3.100.0030.0236.63
4.3.90.0100.0176.63
4.3.80.0000.0406.63
4.3.70.0070.0276.63
4.3.60.0030.0206.63
4.3.50.0100.0236.63
4.3.40.0070.0436.63
4.3.30.0070.0236.63
4.3.20.0000.0236.63
4.3.10.0030.0306.63
4.3.00.0100.0236.47

preferences:
37.06 ms | 401 KiB | 5 Q