3v4l.org

run code in 300+ PHP versions simultaneously
<?php class prototype { private $inherited; private $instance; public function __construct(prototype $prototype = null) { $this->inherited = $prototype; $this->instance = []; } public function __set($name, $value) { if ($value instanceof \Closure) { $value = $value->bindTo($this); } $this->instance[$name] = $value; } public function __get($name) { if (array_key_exists($name, $this->instance)) { return $this->instance[$name]; } else { return $this->inherited->$name; } } public function __call($name, $arguments) { if (!isset($this->instance[$name])) { if (!isset($this->inherited) || !($fromPrototype = $this->inherited->$name) instanceof \Closure) { return; // or better, blow up } $this->instance[$name] = $fromPrototype->bindTo($this); } if (!($this->instance[$name] instanceof \Closure)) { return; // or better, blow up } return call_user_func_array($this->instance[$name], $arguments); } } $foo = new prototype; $foo->foo = 'Foo!'; $foo->bar = function() { return $this->foo; }; $bar = new prototype($foo); $bar->foo = 'Bar!'; echo $foo->bar() . "\n"; echo $bar->bar() . "\n";

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.00316.75
8.3.50.0100.01022.05
8.3.40.0040.01118.75
8.3.30.0130.00619.05
8.3.20.0040.00420.29
8.3.10.0060.00323.36
8.3.00.0040.00420.71
8.2.180.0150.00018.18
8.2.170.0110.00422.96
8.2.160.0050.00820.45
8.2.150.0110.00724.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00020.81
8.2.110.0090.00020.38
8.2.100.0060.00617.72
8.2.90.0050.00319.34
8.2.80.0000.00818.05
8.2.70.0050.00317.50
8.2.60.0030.00617.93
8.2.50.0030.00518.07
8.2.40.0090.00018.16
8.2.30.0040.00418.06
8.2.20.0050.00217.62
8.2.10.0000.00717.71
8.2.00.0000.00717.67
8.1.280.0070.01425.92
8.1.270.0080.00021.97
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00622.04
8.1.230.0090.00322.62
8.1.220.0030.00617.74
8.1.210.0030.00518.77
8.1.200.0030.00617.38
8.1.190.0080.00017.55
8.1.180.0040.00418.10
8.1.170.0060.00618.32
8.1.160.0050.00322.04
8.1.150.0040.00418.54
8.1.140.0040.00417.39
8.1.130.0000.00817.81
8.1.120.0040.00417.47
8.1.110.0040.00417.48
8.1.100.0040.00417.54
8.1.90.0050.00217.44
8.1.80.0030.00617.39
8.1.70.0070.00017.43
8.1.60.0000.00817.55
8.1.50.0030.00617.57
8.1.40.0030.00517.54
8.1.30.0000.00817.57
8.1.20.0000.00817.64
8.1.10.0040.00417.61
8.1.00.0070.00017.60
8.0.300.0000.00818.77
8.0.290.0040.00416.80
8.0.280.0030.00318.45
8.0.270.0030.00316.76
8.0.260.0030.00316.73
8.0.250.0000.00816.98
8.0.240.0000.00716.92
8.0.230.0070.00016.98
8.0.220.0070.00016.80
8.0.210.0070.00016.82
8.0.200.0030.00316.84
8.0.190.0070.00317.02
8.0.180.0000.00816.97
8.0.170.0040.00416.83
8.0.160.0050.00216.83
8.0.150.0000.00716.85
8.0.140.0080.00316.84
8.0.130.0030.00313.35
8.0.120.0000.00716.85
8.0.110.0000.00716.80
8.0.100.0040.00416.89
8.0.90.0020.00516.88
8.0.80.0120.00616.88
8.0.70.0000.00817.03
8.0.60.0050.00316.87
8.0.50.0000.00816.73
8.0.30.0100.01217.35
8.0.20.0130.00717.40
8.0.10.0040.00417.03
8.0.00.0100.00916.73
7.4.330.0030.00215.07
7.4.320.0060.00016.62
7.4.300.0060.00316.51
7.4.290.0000.00716.62
7.4.280.0060.00016.50
7.4.270.0000.00716.63
7.4.260.0000.00816.50
7.4.250.0030.00516.50
7.4.240.0050.00216.65
7.4.230.0080.00016.62
7.4.220.0130.00316.57
7.4.210.0080.00816.51
7.4.200.0000.00816.72
7.4.190.0050.00316.66
7.4.160.0070.01016.35
7.4.150.0180.00017.40
7.4.140.0080.00917.86
7.4.130.0080.01016.43
7.4.120.0160.00516.46
7.4.110.0030.01316.56
7.4.100.0040.01716.41
7.4.90.0110.01416.63
7.4.80.0090.00919.39
7.4.70.0140.00316.48
7.4.60.0070.01016.53
7.4.50.0060.00316.43
7.4.40.0090.00622.77
7.4.30.0070.01416.69
7.4.10.0060.01114.99
7.4.00.0070.00914.86
7.3.330.0030.00313.39
7.3.320.0000.00613.37
7.3.310.0000.00716.47
7.3.300.0000.00716.38
7.3.290.0140.00016.26
7.3.280.0090.00716.37
7.3.270.0090.01617.40
7.3.260.0070.01016.33
7.3.250.0110.00816.54
7.3.240.0100.01316.41
7.3.230.0080.01116.54
7.3.210.0090.00916.71
7.3.200.0180.00019.39
7.3.190.0110.00616.51
7.3.180.0060.01116.66
7.3.170.0040.01216.39
7.3.160.0100.00716.43
7.3.130.0090.00914.85
7.3.120.0060.01014.93
7.3.110.0090.00814.92
7.3.100.0060.00814.76
7.3.90.0070.00514.82
7.3.80.0060.00914.88
7.3.70.0060.00614.67
7.3.60.0050.01014.92
7.3.50.0070.00714.79
7.3.40.0080.00714.90
7.3.30.0070.00514.59
7.3.20.0050.00816.54
7.3.10.0060.00716.65
7.3.00.0070.00616.74
7.2.330.0120.00616.60
7.2.320.0140.00416.38
7.2.310.0180.00416.80
7.2.300.0100.01316.48
7.2.290.0140.00316.69
7.2.260.0070.01015.04
7.2.250.0090.00615.06
7.2.240.0080.00915.10
7.2.230.0040.01015.08
7.2.220.0040.00914.85
7.2.210.0030.00915.04
7.2.200.0060.01215.08
7.2.190.0100.00414.90
7.2.180.0060.00715.11
7.2.170.0070.00515.14
7.2.160.0110.00415.07
7.2.150.0040.00616.80
7.2.140.0080.00516.78
7.2.130.0060.00716.71
7.2.120.0100.00516.72
7.2.110.0030.01216.68
7.2.100.0060.01016.79
7.2.90.0060.01116.86
7.2.80.0080.00817.01
7.2.70.0070.01016.95
7.2.60.0060.00816.82
7.2.50.0060.00917.03
7.2.40.0080.00516.85
7.2.30.0050.00916.70
7.2.20.0050.00816.96
7.2.10.0060.00716.76
7.2.00.0070.00617.40
7.1.330.0060.00915.72
7.1.320.0050.00915.90
7.1.310.0090.00515.77
7.1.300.0040.00715.67
7.1.290.0050.00715.79
7.1.280.0060.00515.77
7.1.270.0060.00815.91
7.1.260.0050.00615.65
7.1.250.0060.00815.61
7.1.240.0020.01315.95
7.1.230.0080.00515.66
7.1.220.0070.00415.65
7.1.210.0040.00815.66
7.1.200.0090.00515.91
7.1.190.0070.00715.72
7.1.180.0070.00815.74
7.1.170.0030.00815.81
7.1.160.0080.00515.72
7.1.150.0060.00615.78
7.1.140.0020.00815.88
7.1.130.0070.00515.84
7.1.120.0040.01015.70
7.1.110.0030.00915.59
7.1.100.0030.00716.66
7.1.90.0050.01115.89
7.1.80.0030.01015.77
7.1.70.0080.00516.01
7.1.60.0060.01016.89
7.1.50.0070.01016.25
7.1.40.0050.01015.70
7.1.30.0120.00315.72
7.1.20.0080.00815.69
7.1.10.0080.00615.62
7.1.00.0080.02917.90
7.0.330.0070.00715.40
7.0.320.0090.00315.41
7.0.310.0020.01215.44
7.0.300.0050.00815.49
7.0.290.0040.00915.37
7.0.280.0030.00915.44
7.0.270.0080.00515.43
7.0.260.0090.00515.40
7.0.250.0030.00715.41
7.0.240.0070.00515.35
7.0.230.0030.00815.28
7.0.220.0040.01015.44
7.0.210.0070.00915.39
7.0.200.0030.00915.92
7.0.190.0010.01015.46
7.0.180.0010.00915.45
7.0.170.0070.00415.53
7.0.160.0050.00515.51
7.0.150.0000.01115.50
7.0.140.0060.03017.67
7.0.130.0050.00815.46
7.0.120.0020.00915.31
7.0.110.0020.01015.31
7.0.100.0090.00815.51
7.0.90.0100.00215.52
7.0.80.0020.01415.45
7.0.70.0090.00515.45
7.0.60.0070.03516.92
7.0.50.0070.02616.23
7.0.40.0090.02515.54
7.0.30.0150.02915.75
7.0.20.0140.01615.62
7.0.10.0110.03215.64
7.0.00.0060.03515.75
5.6.400.0060.00814.37
5.6.390.0050.00914.52
5.6.380.0070.00514.60
5.6.370.0070.00514.59
5.6.360.0050.00514.76
5.6.350.0050.00714.54
5.6.340.0040.01114.56
5.6.330.0060.00614.63
5.6.320.0080.00614.22
5.6.310.0080.00414.71
5.6.300.0060.00614.72
5.6.290.0040.01014.81
5.6.280.0060.03116.65
5.6.270.0060.00514.34
5.6.260.0050.01214.54
5.6.250.0100.00514.47
5.6.240.0030.01314.47
5.6.230.0080.00714.47
5.6.220.0100.00714.32
5.6.210.0070.03216.61
5.6.200.0080.02415.75
5.6.190.0040.03816.36
5.6.180.0030.02116.38
5.6.170.0150.01716.57
5.6.160.0030.02216.47
5.6.150.0080.03015.66
5.6.140.0050.03415.88
5.6.130.0020.02715.75
5.6.120.0100.03216.64
5.6.110.0070.02716.56
5.6.100.0020.01916.73
5.6.90.0070.03516.69
5.6.80.0100.02116.50
5.6.70.0110.02616.54
5.6.60.0050.00814.24
5.6.50.0070.00514.47
5.6.40.0040.00714.50
5.6.30.0080.01014.25
5.6.20.0090.00614.57
5.6.10.0050.01014.49
5.6.00.0050.00914.52
5.5.380.0040.01314.60
5.5.370.0060.00814.52
5.5.360.0090.00514.38
5.5.350.0040.02616.50
5.5.340.0040.03415.68
5.5.330.0030.03816.43
5.5.320.0030.02016.30
5.5.310.0130.03316.48
5.5.300.0060.02015.68
5.5.290.0080.02215.62
5.5.280.0050.01916.58
5.5.270.0070.03416.61
5.5.260.0070.02716.49
5.5.250.0050.03516.40
5.5.240.0080.02516.40
5.5.230.0030.00814.35
5.5.220.0050.00614.33
5.5.210.0020.01414.14
5.5.200.0020.00714.33
5.5.190.0030.01214.44
5.5.180.0090.00514.56
5.5.170.0030.01014.33
5.5.160.0050.01214.38
5.5.150.0050.00714.51
5.5.140.0060.00714.15
5.5.130.0050.00714.54
5.5.120.0130.00014.39
5.5.110.0060.00714.55
5.5.100.0030.01014.28
5.5.90.0030.00914.59
5.5.80.0030.00814.30
5.5.70.0050.00614.35
5.5.60.0030.00914.33
5.5.50.0050.00914.44
5.5.40.0020.01214.65
5.5.30.0050.00814.21
5.5.20.0070.00514.63
5.5.10.0020.01114.09
5.5.00.0050.01014.39
5.4.450.0120.01514.32
5.4.440.0120.01714.28
5.4.430.0110.02414.29
5.4.420.0090.01814.21
5.4.410.0090.01914.22
5.4.400.0100.01614.17
5.4.390.0090.01614.20
5.4.380.0080.03214.13
5.4.370.0110.01613.97
5.4.360.0080.01614.12
5.4.350.0080.01913.99
5.4.340.0090.02114.09
5.4.330.0020.00711.51
5.4.320.0110.01614.14
5.4.310.0090.02314.11
5.4.300.0100.02014.05
5.4.290.0080.03014.17
5.4.280.0090.01814.10
5.4.270.0080.03113.95
5.4.260.0120.02614.13
5.4.250.0080.01814.18
5.4.240.0130.02514.07
5.4.230.0120.02513.93
5.4.220.0100.01814.25
5.4.210.0170.02814.00
5.4.200.0060.02514.21
5.4.190.0130.01714.04
5.4.180.0090.02214.13
5.4.170.0140.01714.02
5.4.160.0130.02314.12
5.4.150.0070.02614.13
5.4.140.0080.01913.23
5.4.130.0130.02413.24
5.4.120.0080.01613.20
5.4.110.0050.01913.33
5.4.100.0080.01813.22
5.4.90.0120.01713.16
5.4.80.0070.02013.34
5.4.70.0060.01913.14
5.4.60.0140.02313.25
5.4.50.0080.02613.09
5.4.40.0080.02613.18
5.4.30.0080.01613.22
5.4.20.0070.01913.14
5.4.10.0060.01813.20
5.4.00.0080.01513.04
5.3.290.0120.01412.43
5.3.280.0120.01212.35
5.3.270.0070.02212.38
5.3.260.0050.01912.39
5.3.250.0090.01612.35
5.3.240.0090.02312.40
5.3.230.0120.02612.35
5.3.220.0130.01012.34
5.3.210.0130.01512.34
5.3.200.0080.02212.30
5.3.190.0090.01512.33
5.3.180.0080.01512.41
5.3.170.0100.02112.33
5.3.160.0080.01712.36
5.3.150.0090.01612.38
5.3.140.0110.02012.30
5.3.130.0090.01712.33
5.3.120.0080.01712.35
5.3.110.0070.01612.32
5.3.100.0100.01412.19
5.3.90.0090.01612.15
5.3.80.0090.01412.15
5.3.70.0090.01712.13
5.3.60.0140.02012.12
5.3.50.0100.01712.16
5.3.40.0080.01612.15
5.3.30.0080.01812.14
5.3.20.0040.01712.09
5.3.10.0100.01412.00
5.3.00.0100.01412.06
5.2.170.0130.03011.16
5.2.160.0070.03711.07
5.2.150.0170.03711.08
5.2.140.0130.03011.11
5.2.130.0170.03011.06
5.2.120.0200.02711.18
5.2.110.0270.04011.25
5.2.100.0130.03011.02
5.2.90.0070.03711.16
5.2.80.0100.04011.07
5.2.70.0100.03311.07
5.2.60.0130.03010.98
5.2.50.0300.02011.13
5.2.40.0170.03311.14
5.2.30.0070.03310.95
5.2.20.0170.02310.93
5.2.10.0070.03010.87
5.2.00.0130.03010.72
5.1.60.0200.02710.00
5.1.50.0100.0239.93
5.1.40.0130.0439.98
5.1.30.0030.03310.34
5.1.20.0100.04710.25
5.1.10.0170.02010.06
5.1.00.0100.02710.00
5.0.50.0100.0178.52
5.0.40.0030.0208.30
5.0.30.0070.0308.21
5.0.20.0100.0178.10
5.0.10.0100.0178.18
5.0.00.0100.0378.32
4.4.90.0030.0177.88
4.4.80.0030.0277.88
4.4.70.0070.0137.88
4.4.60.0100.0107.88
4.4.50.0070.0137.88
4.4.40.0070.0537.88
4.4.30.0070.0177.88
4.4.20.0070.0237.88
4.4.10.0070.0177.88
4.4.00.0070.0437.88
4.3.110.0030.0177.88
4.3.100.0030.0177.88
4.3.90.0030.0177.88
4.3.80.0070.0507.88
4.3.70.0170.0277.88
4.3.60.0070.0277.88
4.3.50.0070.0277.88
4.3.40.0030.0307.88
4.3.30.0030.0407.88
4.3.20.0030.0207.88
4.3.10.0000.0377.88
4.3.00.0030.0307.88

preferences:
44.26 ms | 401 KiB | 5 Q