3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Ex extends \ReflectionException { public $reflector; public function __construct($reflector, $message = '', \Exception $previous = null) { parent::__construct($message, 0, $previous); $this->reflector = $reflector; } } class A { private $private = 'private'; public $public = 'public'; public static $static = 'static'; public function privateMethod() { } } class B { private $private = 'private'; public $public = 'public'; } class C extends \ReflectionClass { public function __construct($name) { try { parent::__construct($name); } catch (\Exception $e) { throw new Ex($this, $e->getMessage(), $e); } } } $r = new \ReflectionClass('A'); $p = $r->getProperty('static'); $p->getValue('bla'); die(); //$p->setAccessible(true); //$p->setAccessible(false); try { $p->invoke(new A()); } catch (\ReflectionException $e) { var_dump($e->getCode()); } die(); $c = new B(); $p->setValue($c, 'b'); var_dump($p->getValue(new stdClass())); //$p = $r->getProperty('public'); //$p->setAccessible(false); //var_dump($p->getValue(true));

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.00616.50
8.3.50.0120.01017.38
8.3.40.0140.00418.73
8.3.30.0090.00618.71
8.3.20.0060.00318.73
8.3.10.0040.00420.65
8.3.00.0080.00019.38
8.2.180.0100.01018.54
8.2.170.0100.01022.96
8.2.160.0100.00721.24
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0050.00326.16
8.2.120.0050.00320.70
8.2.110.0040.00420.34
8.2.100.0060.00619.45
8.2.90.0000.00918.09
8.2.80.0000.00817.97
8.2.70.0030.00717.50
8.2.60.0000.00818.04
8.2.50.0030.00518.07
8.2.40.0080.00018.03
8.2.30.0040.00418.11
8.2.20.0040.00417.64
8.2.10.0040.00417.81
8.2.00.0030.00617.63
8.1.280.0190.00425.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.08
8.1.230.0040.00820.95
8.1.220.0040.00417.74
8.1.210.0090.00018.84
8.1.200.0040.00417.13
8.1.190.0080.00017.54
8.1.180.0040.00418.10
8.1.170.0080.00018.71
8.1.160.0020.00518.86
8.1.150.0040.00418.47
8.1.140.0070.00017.29
8.1.130.0000.00717.87
8.1.120.0070.00017.43
8.1.110.0000.00817.43
8.1.100.0040.00417.27
8.1.90.0040.00417.41
8.1.80.0000.00717.40
8.1.70.0030.00317.29
8.1.60.0030.00617.56
8.1.50.0080.00017.37
8.1.40.0050.00317.54
8.1.30.0040.00417.54
8.1.20.0030.00617.65
8.1.10.0050.00317.59
8.1.00.0000.00717.60
8.0.300.0040.00420.16
8.0.290.0040.00416.75
8.0.280.0030.00318.34
8.0.270.0000.00717.26
8.0.260.0000.00718.30
8.0.250.0040.00417.01
8.0.240.0000.00916.94
8.0.230.0030.00316.87
8.0.220.0030.00316.95
8.0.210.0000.00716.84
8.0.200.0000.00716.96
8.0.190.0030.00317.03
8.0.180.0040.00416.83
8.0.170.0000.00816.84
8.0.160.0000.00716.90
8.0.150.0030.00516.80
8.0.140.0000.00916.87
8.0.130.0000.00613.29
8.0.120.0040.00416.92
8.0.110.0000.00717.03
8.0.100.0000.00716.93
8.0.90.0070.00016.89
8.0.80.0100.00416.98
8.0.70.0040.00416.86
8.0.60.0050.00216.78
8.0.50.0000.00716.94
8.0.30.0120.00716.98
8.0.20.0060.01316.93
8.0.10.0040.00417.05
8.0.00.0100.01516.61
7.4.330.0050.00012.93
7.4.320.0000.00616.57
7.4.300.0020.00516.59
7.4.290.0030.00316.43
7.4.280.0000.00816.45
7.4.270.0030.00316.60
7.4.260.0000.00613.23
7.4.250.0000.00716.56
7.4.240.0040.00416.58
7.4.230.0070.00016.59
7.4.220.0040.01716.39
7.4.210.0070.01016.54
7.4.200.0050.00216.50
7.4.190.0000.00716.52
7.4.160.0030.01316.51
7.4.150.0170.00316.56
7.4.140.0060.01116.50
7.4.130.0070.01216.48
7.4.120.0130.00616.45
7.4.110.0080.00816.54
7.4.100.0030.01416.26
7.4.90.0070.01016.41
7.4.80.0100.01316.45
7.4.70.0100.01016.37
7.4.60.0030.01316.46
7.4.50.0050.00816.61
7.4.40.0000.01816.53
7.4.30.0000.01516.36
7.4.00.0080.00414.89
7.3.330.0030.00313.09
7.3.320.0000.00513.13
7.3.310.0030.00316.29
7.3.300.0070.00016.30
7.3.290.0130.00516.28
7.3.280.0060.00916.26
7.3.270.0110.00616.61
7.3.260.0120.00616.48
7.3.250.0100.00716.40
7.3.240.0070.01016.29
7.3.230.0090.00816.27
7.3.210.0000.01716.13
7.3.200.0170.00319.39
7.3.190.0070.01616.29
7.3.180.0060.01116.37
7.3.170.0100.01416.34
7.3.160.0120.00616.47
7.3.120.0030.01114.95
7.2.330.0040.01616.71
7.2.320.0070.01116.66
7.2.310.0150.00316.68
7.2.300.0150.00916.37
7.2.290.0070.01016.33
7.2.00.0080.00619.39
7.1.100.0030.00717.81
7.1.70.0170.00716.93
7.1.60.0100.00719.40
7.1.50.0000.02116.98
7.1.00.0100.05022.30
7.0.200.0050.00216.78
7.0.140.0000.07022.08
7.0.120.0100.06721.99
7.0.60.0000.06019.83
7.0.50.0030.08717.91
7.0.40.0100.08020.27
7.0.30.0230.07020.09
7.0.20.0330.04320.07
7.0.10.0270.08020.06
7.0.00.0100.08320.31
5.6.280.0070.07021.07
5.6.210.0100.07320.54
5.6.200.0070.05718.18
5.6.190.0100.07720.48
5.6.180.0300.06020.61
5.6.170.0270.03720.39
5.6.160.0000.04320.44
5.6.150.0000.04718.27
5.6.140.0070.08318.16
5.6.130.0100.07718.21
5.6.120.0070.07021.16
5.6.110.0100.08021.04
5.6.100.0100.05321.02
5.6.90.0100.07721.19
5.6.80.0070.04020.44
5.6.70.0270.07720.43
5.5.350.0330.05720.44
5.5.340.0000.04718.05
5.5.330.0100.08320.26
5.5.320.0170.03720.28
5.5.310.0270.08020.30
5.5.300.0100.07317.98
5.5.290.0030.06717.97
5.5.280.0130.04320.80
5.5.270.0100.08020.91
5.5.260.0070.04021.01
5.5.250.0070.05720.54
5.5.240.0170.06020.27
5.4.450.0070.06719.53
5.4.440.0070.05319.53
5.4.430.0030.07019.44
5.4.420.0130.07019.30
5.4.410.0070.06019.31
5.4.400.0030.07318.86
5.4.390.0070.04719.00
5.4.380.0100.07019.20
5.4.370.0130.05718.87
5.4.360.0070.06318.87
5.4.350.0030.07019.07
5.4.340.0100.07319.08
5.4.320.0170.06719.25
5.4.310.0100.04018.88
5.4.300.0070.07019.15
5.4.290.0070.06019.24
5.4.280.0100.05019.14
5.4.270.0000.08019.14
5.4.260.0030.06019.20
5.4.250.0000.07719.07
5.4.240.0100.07319.11
5.4.230.0100.05019.20
5.4.220.0070.07318.99
5.4.210.0070.05319.20
5.4.200.0100.07319.23
5.4.190.0100.07018.86
5.4.180.0070.07318.91
5.4.170.0030.08018.84
5.4.160.0070.04318.85
5.4.150.0100.07318.83
5.4.140.0030.05716.34
5.4.130.0030.06316.54
5.4.120.0030.04016.42
5.4.110.0070.03316.70
5.4.100.0070.03316.70
5.4.90.0100.02716.44
5.4.80.0070.03016.46
5.4.70.0070.03016.42
5.4.60.0000.03716.39
5.4.50.0030.04316.42
5.4.40.0100.03316.29
5.4.30.0000.03716.40
5.4.20.0030.03716.37
5.4.10.0000.04016.36
5.4.00.0030.03715.88
5.3.290.0100.04314.70
5.3.280.0070.07714.65
5.3.270.0070.07014.69
5.3.260.0030.08014.55
5.3.250.0130.07314.68
5.3.240.0000.06714.69
5.3.230.0000.08314.70
5.3.220.0070.05014.63
5.3.210.0030.04014.55
5.3.200.0030.04014.50
5.3.190.0030.03714.50
5.3.180.0030.03714.52
5.3.170.0000.04314.59
5.3.160.0030.04014.74
5.3.150.0070.03314.65
5.3.140.0100.03014.73
5.3.130.0070.03714.60
5.3.120.0030.06714.63
5.3.110.0000.06314.58
5.3.100.0030.04014.12
5.3.90.0030.05014.08
5.3.80.0030.04014.10
5.3.70.0100.03014.04
5.3.60.0070.03314.03
5.3.50.0070.03313.97
5.3.40.0030.03713.90
5.3.30.0030.03313.93
5.3.20.0030.03313.88
5.3.10.0030.03313.72
5.3.00.0070.03313.68
5.2.170.0000.03011.19
5.2.160.0030.02711.13
5.2.150.0070.02311.18
5.2.140.0000.03011.24
5.2.130.0030.03011.13
5.2.120.0070.02311.28
5.2.110.0030.02711.17
5.2.100.0100.02711.14
5.2.90.0030.03011.09
5.2.80.0030.03011.29
5.2.70.0030.02711.09
5.2.60.0000.03011.13
5.2.50.0000.03010.96
5.2.40.0030.03011.09
5.2.30.0070.02711.07
5.2.20.0070.02311.00
5.2.10.0030.02710.89
5.2.00.0030.03010.76
5.1.60.0000.02710.09
5.1.50.0030.02310.00
5.1.40.0000.02710.00
5.1.30.0070.02710.36
5.1.20.0030.02310.43
5.1.10.0030.02310.25
5.1.00.0070.02010.24
5.0.50.0030.0178.63
5.0.40.0030.0178.36
5.0.30.0030.0278.28
5.0.20.0030.0338.25
5.0.10.0000.0308.23
5.0.00.0000.0408.19
4.4.90.0030.0137.99
4.4.80.0030.0177.99
4.4.70.0000.0177.99
4.4.60.0030.0137.99
4.4.50.0000.0177.99
4.4.40.0030.0207.99
4.4.30.0000.0177.99
4.4.20.0000.0177.99
4.4.10.0000.0207.99
4.4.00.0000.0237.99
4.3.110.0000.0177.99
4.3.100.0030.0277.99
4.3.90.0000.0237.99
4.3.80.0070.0307.99
4.3.70.0070.0337.99
4.3.60.0030.0277.99
4.3.50.0070.0337.99
4.3.40.0070.0437.99
4.3.30.0000.0377.99
4.3.20.0030.0377.99
4.3.10.0030.0337.99
4.3.00.0000.0277.99

preferences:
41.02 ms | 401 KiB | 5 Q