3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $_field = "abcdefghijklmnopqrstuvwxyz"; public function __get($name) { echo 'method called' . PHP_EOL; die; } } 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.4.00.0130.00914.97
7.3.120.0100.01314.79
7.3.110.0070.01614.68
7.3.100.0040.01514.63
7.3.90.0040.01414.75
7.3.80.0040.01515.11
7.3.70.0030.01614.68
7.3.60.0060.01214.79
7.3.50.0090.00914.46
7.3.40.0070.01014.73
7.3.30.0060.00914.61
7.3.20.0070.01016.63
7.3.10.0060.00916.76
7.3.00.0070.01316.53
7.2.250.0040.01815.06
7.2.240.0060.02115.31
7.2.230.0060.01314.96
7.2.220.0090.01214.63
7.2.210.0090.00614.75
7.2.200.0090.01215.05
7.2.190.0070.01415.07
7.2.180.0000.02015.15
7.2.170.0060.01614.93
7.2.00.0030.01719.45
7.1.330.0030.02415.93
7.1.320.0090.01915.75
7.1.310.0030.01715.81
7.1.300.0030.02515.52
7.1.290.0040.02215.64
7.1.280.0030.02315.72
7.1.270.0030.02115.96
7.1.260.0000.02215.55
7.1.70.0040.00717.36
7.1.60.0090.02519.40
7.1.50.0230.01334.45
7.1.00.0030.07022.36
7.0.200.0360.01014.72
7.0.140.0100.06722.09
7.0.120.0030.08022.13
7.0.60.0130.08019.98
7.0.50.0030.04317.98
7.0.40.0070.08720.13
7.0.30.0070.05020.39
7.0.20.0000.04720.39
7.0.10.0070.04320.02
7.0.00.0170.03720.10
5.6.280.0100.08021.12
5.6.210.0000.08720.77
5.6.200.0070.06018.29
5.6.190.0000.09720.41
5.6.180.0000.06020.48
5.6.170.0030.05020.33
5.6.160.0000.05020.60
5.6.150.0030.04720.43
5.6.140.0000.05320.17
5.6.130.0030.05020.50
5.6.120.0000.05020.32
5.6.110.0170.04320.16
5.6.100.0100.04020.39
5.6.90.0070.09020.39
5.6.80.0000.06719.58
5.6.70.0100.08319.82
5.6.60.0270.08319.80
5.6.50.0030.09719.91
5.6.40.0030.07019.80
5.6.30.0070.08019.86
5.6.20.0030.09019.85
5.6.10.0100.09019.73
5.6.00.0100.08719.56
5.5.350.0200.07020.45
5.5.340.0100.08717.98
5.5.330.0030.04720.43
5.5.320.0000.05320.43
5.5.310.0070.05320.25
5.5.300.0070.04720.14
5.5.290.0030.05019.99
5.5.280.0000.05020.24
5.5.270.0100.04020.29
5.5.260.0000.09020.11
5.5.250.0100.08719.95
5.5.240.0030.05019.36
5.5.230.0100.08719.67
5.5.220.0030.07019.36
5.5.210.0070.07019.58
5.5.200.0070.09319.56
5.5.190.0000.06719.34
5.5.180.0070.09019.56
5.5.160.0030.09719.48
5.5.150.0030.09319.32
5.5.140.0030.07019.38
5.5.130.0100.06719.32
5.5.120.0070.05719.48
5.5.110.0070.07719.55
5.5.100.0070.09019.21
5.5.90.0030.08019.43
5.5.80.0030.09719.55
5.5.70.0000.07019.28
5.5.60.0030.06319.37
5.5.50.0000.09719.53
5.5.40.0070.06719.39
5.5.30.0070.09319.47
5.5.20.0030.07019.46
5.5.10.0170.08319.62
5.5.00.0000.09719.45
5.4.450.0000.05019.40
5.4.440.0000.04719.47
5.4.430.0000.04719.47
5.4.420.0000.05319.18
5.4.410.0030.09019.44
5.4.400.0030.05318.93
5.4.390.0130.08018.87
5.4.380.0030.07318.88
5.4.370.0000.09319.16
5.4.360.0070.07718.87
5.4.350.0000.09719.00
5.4.340.0030.09719.21
5.4.320.0070.09018.94
5.4.310.0330.07319.15
5.4.300.0000.07018.84
5.4.290.0000.09719.15
5.4.280.0000.05718.98
5.4.270.0030.09019.14
5.4.260.0000.09718.85
5.4.250.0030.07019.21
5.4.240.0030.08719.23
5.4.230.0030.08719.24
5.4.220.0000.08019.07
5.4.210.0100.06719.15
5.4.200.0000.07718.92
5.4.190.0000.08719.23
5.4.180.0100.08719.10
5.4.170.0030.09019.00
5.4.160.0070.09719.19
5.4.150.0030.09319.13
5.4.140.0030.09016.38
5.4.130.0100.08316.42
5.4.120.0030.06316.50
5.4.110.0030.06016.49
5.4.100.0030.08316.50
5.4.90.0000.06716.52
5.4.80.0070.09016.38
5.4.70.0000.09016.32
5.4.60.0130.07316.43
5.4.50.0000.08316.40
5.4.40.0030.07316.64
5.4.30.0100.07716.27
5.4.20.0070.07016.52
5.4.10.0030.09016.27
5.4.00.0070.08315.89
5.3.290.0070.09314.71
5.3.280.0070.09314.75
5.3.270.0030.10314.54
5.3.260.0030.06314.62
5.3.250.0030.10014.68
5.3.240.0130.08014.61
5.3.230.0000.09714.64
5.3.220.0000.10014.57
5.3.210.0070.10314.46
5.3.200.0030.09714.62
5.3.190.0070.10014.73
5.3.180.0000.06314.57
5.3.170.0100.04714.61
5.3.160.0030.08314.64
5.3.150.0130.05314.45
5.3.140.0100.07314.63
5.3.130.0070.07714.57
5.3.120.0000.09014.61
5.3.110.0030.07714.56
5.3.100.0070.08314.09
5.3.90.0070.06314.03
5.3.80.0030.09313.96
5.3.70.0000.07014.07
5.3.60.0000.09713.99
5.3.50.0000.07313.95
5.3.40.0030.09713.87
5.3.30.0070.09313.86
5.3.20.0000.10013.69
5.3.10.0030.09013.71
5.3.00.0000.07313.59
5.2.170.0030.09313.28
5.2.160.0030.08313.28
5.2.150.0030.09013.28
5.2.140.0000.10013.28
5.2.130.0000.09313.28
5.2.120.0070.08713.28
5.2.110.0030.09013.28
5.2.100.0030.08313.28
5.2.90.0100.06013.28
5.2.80.0000.10013.28
5.2.70.0230.07313.28
5.2.60.0030.10013.28
5.2.50.0030.06313.28
5.2.40.0030.09013.28
5.2.30.0000.09313.28
5.2.20.0000.08013.28
5.2.10.0030.06713.28
5.2.00.0030.07713.28
5.1.60.0000.08313.28
5.1.50.0070.06313.28
5.1.40.0030.08013.28
5.1.30.0070.08313.28
5.1.20.0030.09013.28
5.1.10.0100.08313.28
5.1.00.0000.08313.28
5.0.50.0030.09313.28
5.0.40.0030.10713.28
5.0.30.0030.11313.28
5.0.20.0000.10713.28
5.0.10.0000.10013.28
5.0.00.0030.11313.28
4.4.90.0000.03713.28
4.4.80.0000.03313.28
4.4.70.0030.02013.28
4.4.60.0100.01313.28
4.4.50.0000.02313.28
4.4.40.0070.05013.28
4.4.30.0030.03713.28
4.4.20.0070.03013.28
4.4.10.0030.02713.28
4.4.00.0070.05013.28
4.3.110.0070.03013.28
4.3.100.0070.03013.28
4.3.90.0030.03313.28
4.3.80.0000.05713.28
4.3.70.0000.03313.28
4.3.60.0000.03313.28
4.3.50.0000.02713.28
4.3.40.0070.05013.28
4.3.30.0070.02713.28
4.3.20.0030.03713.28
4.3.10.0000.03713.28
4.3.00.0070.02313.28

preferences:
37.69 ms | 400 KiB | 5 Q