3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace NS1 { class c1 { public function __construct(\NS2\c1 $c1) { } } } namespace NS2 { class c1 { public function __construct() { } } } namespace Foo { error_reporting(E_ALL); ini_seT('display_errors', 'on'); $r = new ReflectionClass('\NS1\c1'); echo $r->getName(); echo '<br />'; echo $r->getConstructor()->getParameters()[0]->getClass()->getName(); die; class Kitchen { private $yummy = 'cake'; } $sweetsThief = function (\Dice\Dice $kitchen) { return $kitchen->cache; }; $dice = new \Dice\Dice; $sweetsThief = Closure::bind($sweetsThief, null, $dice); var_dump($sweetsThief($dice)); class MyCache implements ArrayAccess { private $array = []; public function offsetGet($offset) { return $this->array[$offset]; } public function offsetSet($offset, $value) { $this->array[$offset] = $value; } public function offsetExists() { } } class Cached { private $dice; public function __construct(ArrayAccess $cache = null) { if (isset($cache['dice'])) { $this->dice = $this->cache['dice']; } else $this->dice = new Dice; } public function __destruct() { $clearInstances = function() { $this->instances = []; }; $clearInstances = $clearInstances->bindTo($this->dice, $this->dice); $clearInstances(); $this->cahe['dice'] = $this->dice; } } $a2 = $dice->create('A2', array($dice->create('ExtendedB'), 'Foo')); $cache = new Cached($dice); }

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.0210.00016.75
8.3.50.0140.00721.94
8.3.40.0100.01018.98
8.3.30.0070.01019.04
8.3.20.0120.00321.89
8.3.10.0040.00423.70
8.3.00.0130.00619.07
8.2.180.0160.00618.17
8.2.170.0140.00022.96
8.2.160.0130.00720.30
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00320.84
8.2.110.0070.00320.54
8.2.100.0040.00817.72
8.2.90.0050.00319.13
8.2.80.0000.00817.97
8.2.70.0030.00517.63
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0050.00319.88
8.2.30.0000.00918.35
8.2.20.0040.00417.78
8.2.10.0040.00418.01
8.2.00.0000.00817.66
8.1.280.0070.01125.92
8.1.270.0000.00823.98
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00623.96
8.1.230.0070.00417.45
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0100.00017.35
8.1.190.0050.00317.13
8.1.180.0040.00418.10
8.1.170.0100.00018.64
8.1.160.0000.00822.05
8.1.150.0000.00718.60
8.1.140.0040.00417.39
8.1.130.0070.00017.68
8.1.120.0040.00417.33
8.1.110.0000.00717.37
8.1.100.0060.00317.43
8.1.90.0030.00517.34
8.1.80.0040.00417.34
8.1.70.0030.00317.40
8.1.60.0050.00317.44
8.1.50.0040.00417.38
8.1.40.0030.00717.53
8.1.30.0000.00817.63
8.1.20.0020.00517.59
8.1.10.0000.00717.57
8.1.00.0050.00217.34
8.0.300.0070.00018.77
8.0.290.0040.00417.00
8.0.280.0040.00418.49
8.0.270.0040.00417.30
8.0.260.0030.00317.41
8.0.250.0000.00717.06
8.0.240.0030.00617.07
8.0.230.0030.00317.09
8.0.220.0030.00317.00
8.0.210.0030.00316.98
8.0.200.0000.00816.93
8.0.190.0000.00716.95
8.0.180.0060.00317.02
8.0.170.0020.00516.94
8.0.160.0040.00416.95
8.0.150.0030.00516.91
8.0.140.0030.00316.94
8.0.130.0060.00013.41
8.0.120.0040.00416.95
8.0.110.0040.00416.92
8.0.100.0070.00017.11
8.0.90.0050.00316.95
8.0.80.0110.00416.98
8.0.70.0000.00717.03
8.0.60.0030.00617.05
8.0.50.0020.00516.95
8.0.30.0070.01217.13
8.0.20.0110.00817.40
8.0.10.0040.00417.17
8.0.00.0100.01016.80
7.4.330.0030.00315.00
7.4.320.0030.00316.56
7.4.300.0000.00716.50
7.4.290.0000.00816.38
7.4.280.0040.00416.58
7.4.270.0040.00416.55
7.4.260.0000.00716.58
7.4.250.0070.00016.41
7.4.240.0040.00416.47
7.4.230.0000.00716.39
7.4.220.0070.01116.39
7.4.210.0090.00516.56
7.4.200.0070.00016.46
7.4.190.0000.00716.58
7.4.160.0100.01316.55
7.4.150.0090.00917.40
7.4.140.0130.00917.86
7.4.130.0080.00916.59
7.4.120.0120.00716.44
7.4.110.0170.00716.72
7.4.100.0040.01316.76
7.4.90.0040.01416.57
7.4.80.0130.00419.39
7.4.70.0080.00916.67
7.4.60.0130.01016.54
7.4.50.0000.00616.36
7.4.40.0160.00016.60
7.4.30.0060.01016.65
7.4.00.0060.00915.09
7.3.330.0000.00613.29
7.3.320.0000.00713.39
7.3.310.0000.00716.24
7.3.300.0030.00316.36
7.3.290.0030.01116.36
7.3.280.0070.01116.31
7.3.270.0150.00317.40
7.3.260.0060.01216.42
7.3.250.0070.01216.52
7.3.240.0090.01116.55
7.3.230.0040.01316.39
7.3.210.0090.00916.61
7.3.200.0100.00719.39
7.3.190.0130.00916.51
7.3.180.0080.00816.52
7.3.170.0150.00816.55
7.3.160.0120.00316.48
7.3.120.0070.00914.89
7.3.110.0000.01614.80
7.3.100.0070.00714.70
7.3.90.0040.01115.04
7.3.80.0030.00914.99
7.3.70.0100.00714.89
7.3.60.0070.00714.73
7.3.50.0000.01514.81
7.3.40.0030.01014.61
7.3.30.0060.00614.91
7.3.20.0000.01416.66
7.3.10.0030.01016.54
7.3.00.0080.00416.66
7.2.330.0090.00916.31
7.2.320.0140.00416.70
7.2.310.0100.01416.68
7.2.300.0100.01016.74
7.2.290.0120.00616.60
7.2.250.0070.00714.96
7.2.240.0140.00715.11
7.2.230.0000.01815.11
7.2.220.0070.01114.59
7.2.210.0100.00714.88
7.2.200.0060.00615.05
7.2.190.0040.01114.78
7.2.180.0030.01014.91
7.2.170.0130.00015.01
7.2.60.0080.00416.77
7.2.50.0060.00616.94
7.2.00.0040.00819.47
7.1.330.0000.01415.62
7.1.320.0070.00715.59
7.1.310.0100.00615.51
7.1.300.0030.00715.72
7.1.290.0040.00715.51
7.1.280.0070.00415.67
7.1.270.0040.01115.70
7.1.260.0030.00915.75
7.1.200.0060.00915.64
7.1.100.0090.00617.65
7.1.70.0090.00017.17
7.1.60.0050.00519.46
7.1.50.0100.01016.95
7.1.00.0030.07722.57
7.0.200.0070.00416.84
7.0.140.0100.07022.05
7.0.100.0170.03320.21
7.0.90.0070.05720.03
7.0.80.0470.07320.04
7.0.70.0100.03319.91
7.0.60.0070.04019.99
7.0.50.0000.04720.37
7.0.40.0030.03720.15
7.0.30.0030.04320.10
7.0.20.0000.04320.03
7.0.10.0030.04720.18
7.0.00.0030.05719.95
5.6.280.0070.06721.14
5.6.250.0000.04720.52
5.6.240.0000.08320.56
5.6.230.0000.09020.51
5.6.220.0100.03720.64
5.6.210.0070.04020.80
5.6.200.0030.06721.07
5.6.190.0070.04021.14
5.6.180.0000.05320.98
5.6.170.0030.04321.05
5.6.160.0000.04721.07
5.6.150.0000.04720.96
5.6.140.0070.05721.05
5.6.130.0000.04321.05
5.6.120.0070.03721.06
5.6.110.0100.04021.04
5.6.100.0070.06721.08
5.6.90.0070.05021.09
5.6.80.0030.04020.52
5.6.70.0070.03720.46
5.6.60.0030.06020.43
5.6.50.0170.07320.54
5.6.40.0070.08020.41
5.6.30.0130.07720.47
5.6.20.0200.06020.55
5.6.10.0130.07720.42
5.6.00.0030.05320.41
5.5.380.0130.04020.43
5.5.370.0100.05320.48
5.5.360.0000.04720.38
5.5.350.0100.03720.50
5.5.340.0100.03320.82
5.5.330.0000.04020.83
5.5.320.0030.07020.80
5.5.310.0000.04720.89
5.5.300.0070.04020.80
5.5.290.0130.03320.94
5.5.280.0030.04320.66
5.5.270.0030.04020.93
5.5.260.0100.03320.90
5.5.250.0030.04320.71
5.5.240.0000.05020.27
5.5.230.0070.04020.25
5.5.220.0030.08020.31
5.5.210.0100.06720.06
5.5.200.0100.06020.30
5.5.190.0070.07320.12
5.5.180.0030.05320.16
5.5.160.0070.08020.16
5.5.150.0100.07020.02
5.5.140.0100.08020.11
5.5.130.0130.07020.00
5.5.120.0000.08720.22
5.5.110.0070.07320.27
5.5.100.0030.08020.05
5.5.90.0170.06320.20
5.5.80.0000.04720.05
5.5.70.0130.07320.15
5.5.60.0130.04320.07
5.5.50.0070.08020.10
5.5.40.0100.07320.13
5.5.30.0070.05020.12
5.5.20.0100.08020.13
5.5.10.0100.04319.98
5.5.00.0130.06320.09
5.4.450.0100.03019.23
5.4.440.0070.03719.41
5.4.430.0070.06319.50
5.4.420.0130.03019.37
5.4.410.0070.03719.23
5.4.400.0000.04318.90
5.4.390.0070.05018.85
5.4.380.0100.07319.21
5.4.370.0030.04719.16
5.4.360.0030.06018.88
5.4.350.0070.07319.07
5.4.340.0070.07718.85
5.4.320.0070.07019.12
5.4.310.0070.07719.16
5.4.300.0100.07018.84
5.4.290.0030.08019.06
5.4.280.0130.06319.03
5.4.270.0100.06719.13
5.4.260.0100.03718.86
5.4.250.0070.07718.94
5.4.240.0100.05719.15
5.4.230.0130.07019.23
5.4.220.0070.08019.13
5.4.210.0100.07018.92
5.4.200.0100.04319.03
5.4.190.0130.07319.06
5.4.180.0000.07019.03
5.4.170.0130.06719.02
5.4.160.0030.05319.14
5.4.150.0070.06719.10
5.4.140.0130.06716.52
5.4.130.0100.04016.30
5.4.120.0030.07716.46
5.4.110.0130.06716.38
5.4.100.0000.07716.55
5.4.90.0070.06716.48
5.4.80.0100.07016.41
5.4.70.0070.07316.38
5.4.60.0030.07016.27
5.4.50.0030.07316.34
5.4.40.0070.07316.52
5.4.30.0100.07316.47
5.4.20.0100.06716.50
5.4.10.0030.07316.44
5.4.00.0070.07315.80
5.3.290.0030.05714.75
5.3.280.0070.06714.62
5.3.270.0030.05014.66
5.3.260.0130.04014.75
5.3.250.0000.08014.59
5.3.240.0070.05314.73
5.3.230.0170.06714.53
5.3.220.0070.06014.49
5.3.210.0100.04314.55
5.3.200.0100.07314.63
5.3.190.0130.07314.56
5.3.180.0130.06714.63
5.3.170.0130.07014.69
5.3.160.0070.04714.71
5.3.150.0100.07014.67
5.3.140.0070.07714.52
5.3.130.0070.07314.50
5.3.120.0030.07714.52
5.3.110.0030.08014.60
5.3.100.0130.07013.98
5.3.90.0030.08014.12
5.3.80.0130.06314.03
5.3.70.0030.07314.14
5.3.60.0070.07314.04
5.3.50.0030.07713.97
5.3.40.0030.07714.08
5.3.30.0100.07313.84
5.3.20.0030.07313.71
5.3.10.0170.06013.72
5.3.00.0130.05013.73
5.2.170.0030.06012.36
5.2.160.0000.03312.36
5.2.150.0070.04012.36
5.2.140.0070.06312.36
5.2.130.0070.05712.36
5.2.120.0070.05712.36
5.2.110.0030.03712.36
5.2.100.0000.07012.36
5.2.90.0100.03712.36
5.2.80.0000.04312.36
5.2.70.0030.06012.36
5.2.60.0100.05312.36
5.2.50.0000.05712.36
5.2.40.0030.06312.36
5.2.30.0130.05312.36
5.2.20.0070.06312.36
5.2.10.0100.02712.36
5.2.00.0130.04312.36
5.1.60.0000.05012.36
5.1.50.0030.04712.36
5.1.40.0070.04712.36
5.1.30.0070.05312.36
5.1.20.0070.05312.36
5.1.10.0000.05712.36
5.1.00.0000.03312.36
5.0.50.0030.04712.36
5.0.40.0070.04012.36
5.0.30.0030.06712.36
5.0.20.0070.04012.36
5.0.10.0030.04712.36
5.0.00.0000.06712.36
4.4.90.0030.02712.36
4.4.80.0100.02712.36
4.4.70.0000.03312.36
4.4.60.0030.03312.36
4.4.50.0000.04012.36
4.4.40.0100.04312.36
4.4.30.0070.01312.36
4.4.20.0000.02712.36
4.4.10.0000.04012.36
4.4.00.0000.04012.36
4.3.110.0000.03712.36
4.3.100.0030.02312.36
4.3.90.0070.03012.36
4.3.80.0000.05712.36
4.3.70.0000.03712.36
4.3.60.0030.03312.36
4.3.50.0030.01712.36
4.3.40.0030.05012.36
4.3.30.0000.02712.36
4.3.20.0030.03712.36
4.3.10.0030.03312.36
4.3.00.0030.03312.36

preferences:
42.21 ms | 401 KiB | 5 Q