3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $_field = "abcdefghijklmnopqrstuvwxyz"; public function __get($name) {} } class B { public $_field = "abcdefghijklmnopqrstuvwxyz"; } $a = new A; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $field = $a->_field; $time_taken = microtime(true) - $start; echo 'With get: ' . $time_taken . 's' . PHP_EOL; $b = new B; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $field = $b->_field; $time_taken = microtime(true) - $start; echo 'Without get: ' . $time_taken . 's' . PHP_EOL;

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)
7.2.00.0060.01919.21
7.1.70.0000.01717.22
7.1.60.0100.03819.46
7.1.50.0040.04617.00
7.1.00.0030.09322.36
7.0.200.0040.02116.35
7.0.140.0030.08722.07
7.0.60.0100.09019.88
7.0.50.0170.08317.88
7.0.40.0030.10017.82
7.0.30.0070.08017.89
7.0.20.0070.09317.72
7.0.10.0070.10717.80
7.0.00.0100.09717.75
5.6.280.0070.11021.04
5.6.210.0030.10320.73
5.6.200.0070.06318.22
5.6.190.0130.09718.16
5.6.180.0000.06718.29
5.6.170.0100.09718.12
5.6.160.0070.06018.12
5.6.150.0000.07018.18
5.6.140.0070.06018.15
5.6.130.0070.09318.14
5.6.120.0000.07018.18
5.6.110.0070.07718.27
5.6.100.0030.06718.13
5.6.90.0130.10718.27
5.6.80.0100.09317.57
5.6.70.0100.09017.56
5.6.60.0030.07317.65
5.6.50.0070.11717.54
5.6.40.0130.10317.57
5.6.30.0100.09017.58
5.6.20.0030.07317.54
5.6.10.0100.10717.62
5.6.00.0100.08717.53
5.5.350.0300.08020.31
5.5.340.0100.10717.92
5.5.330.0070.11718.02
5.5.320.0030.10018.03
5.5.310.0070.12017.95
5.5.300.0070.10017.98
5.5.290.0070.11017.95
5.5.280.0070.09018.02
5.5.270.0170.10718.07
5.5.260.0100.10718.01
5.5.250.0000.10017.88
5.5.240.0030.10717.37
5.5.230.0130.10317.34
5.5.220.0000.06717.37
5.5.210.0100.10717.43
5.5.200.0130.07717.42
5.5.190.0070.11317.42
5.5.180.0030.10317.37
5.5.160.0100.05717.30
5.5.150.0030.09717.43
5.5.140.0130.10317.37
5.5.130.0100.08017.35
5.5.120.0070.06717.42
5.5.110.0070.10317.29
5.5.100.0200.10317.23
5.5.90.0000.12017.22
5.5.80.0070.10717.21
5.5.70.0070.11017.20
5.5.60.0170.09317.27
5.5.50.0130.10317.21
5.5.40.0070.11017.19
5.5.30.0130.10017.25
5.5.20.0200.10317.18
5.5.10.0070.06717.23
5.5.00.0070.11717.15
5.4.450.0030.10319.42
5.4.440.0070.09719.42
5.4.430.0100.09319.42
5.4.420.0070.09019.37
5.4.410.0130.08019.14
5.4.400.0070.11319.13
5.4.390.0170.10019.01
5.4.380.0130.09718.95
5.4.370.0100.10019.12
5.4.360.0100.09019.07
5.4.350.0100.10019.04
5.4.340.0100.08319.14
5.4.320.0030.07019.04
5.4.310.0070.10719.13
5.4.300.0030.07019.03
5.4.290.0030.09019.11
5.4.280.0100.09719.26
5.4.270.0100.10319.01
5.4.260.0100.10319.06
5.4.250.0100.10319.04
5.4.240.0130.10319.02
5.4.230.0000.07718.88
5.4.220.0100.08719.04
5.4.210.0030.11319.02
5.4.200.0100.11019.08
5.4.190.0070.09318.96
5.4.180.0130.09719.00
5.4.170.0130.10318.94
5.4.160.0100.07319.24
5.4.150.0030.09318.96
5.4.140.0000.06716.38
5.4.130.0100.08716.40
5.4.120.0070.10316.51
5.4.110.0070.06016.47
5.4.100.0100.05316.64
5.4.90.0070.11016.47
5.4.80.0130.10316.36
5.4.70.0100.10016.44
5.4.60.0100.10316.45
5.4.50.0100.09716.38
5.4.40.0070.10316.51
5.4.30.0100.10316.38
5.4.20.0170.09716.36
5.4.10.0000.06316.40
5.4.00.0030.06716.03
5.3.290.0070.07714.68
5.3.280.0170.11314.55
5.3.270.0000.08314.82
5.3.260.0000.11714.46
5.3.250.0100.08314.56
5.3.240.0200.12314.60
5.3.230.0100.12314.64
5.3.220.0130.12314.60
5.3.210.0100.12314.63
5.3.200.0100.06714.61
5.3.190.0100.13014.42
5.3.180.0030.08314.57
5.3.170.0030.07714.63
5.3.160.0100.12714.66
5.3.150.0070.10014.56
5.3.140.0200.11714.41
5.3.130.0070.13014.59
5.3.120.0070.08714.59
5.3.110.0130.07714.55
5.3.100.0030.07314.08
5.3.90.0000.10013.96
5.3.80.0030.12714.03
5.3.70.0030.07314.23
5.3.60.0030.07014.04
5.3.50.0000.13313.96
5.3.40.0030.07313.84
5.3.30.0130.12313.91
5.3.20.0030.13013.77
5.3.10.0070.06713.55
5.3.00.0030.07013.68
5.2.170.0030.12311.13
5.2.160.0070.07011.36
5.2.150.0070.13011.21
5.2.140.0030.13011.21
5.2.130.0000.10310.95
5.2.120.0030.07011.16
5.2.110.0070.07011.18
5.2.100.0030.07010.95
5.2.90.0030.07011.15
5.2.80.0070.06711.13
5.2.70.0030.08311.13
5.2.60.0030.07711.06
5.2.50.0030.09711.05
5.2.40.0000.08311.07
5.2.30.0000.07010.98
5.2.20.0030.12710.96
5.2.10.0030.08010.91
5.2.00.0030.06710.68
5.1.60.0000.06710.07
5.1.50.0000.06710.07
5.1.40.0000.06310.02
5.1.30.0070.06310.32
5.1.20.0070.06010.57
5.1.10.0000.07010.05
5.1.00.0000.06710.03
5.0.50.0000.0238.58
5.0.40.0000.0208.49
5.0.30.0070.0308.21
5.0.20.0070.0208.30
5.0.10.0030.0178.20
5.0.00.0030.0278.01
4.4.90.0000.0177.58
4.4.80.0000.0137.58
4.4.70.0000.0177.58
4.4.60.0030.0177.58
4.4.50.0100.0077.58
4.4.40.0000.0237.58
4.4.30.0000.0177.58
4.4.20.0030.0137.58
4.4.10.0000.0177.58
4.4.00.0000.0277.58
4.3.110.0030.0137.58
4.3.100.0000.0137.58
4.3.90.0000.0137.58
4.3.80.0000.0237.58
4.3.70.0000.0137.58
4.3.60.0070.0107.58
4.3.50.0030.0137.58
4.3.40.0000.0237.58
4.3.30.0000.0177.58
4.3.20.0000.0177.58
4.3.10.0000.0207.58
4.3.00.0030.0107.58

preferences:
39.47 ms | 400 KiB | 5 Q