3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $_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.4.00.0060.01314.63
7.3.120.0070.01414.72
7.3.110.0080.01114.61
7.3.100.0020.01314.93
7.3.90.0010.01314.83
7.3.80.0100.00814.83
7.3.70.0030.01414.72
7.3.60.0080.01114.80
7.3.50.0050.01614.67
7.3.40.0030.01614.64
7.3.30.0080.01014.75
7.3.20.0090.01116.38
7.3.10.0050.01216.57
7.3.00.0060.01316.55
7.2.250.0000.02315.12
7.2.240.0100.01215.05
7.2.230.0070.01214.82
7.2.220.0080.00915.05
7.2.210.0050.01415.21
7.2.200.0070.01214.85
7.2.190.0110.01015.06
7.2.180.0100.01114.99
7.2.170.0020.02215.06
7.2.160.0070.01414.73
7.2.150.0040.01816.69
7.2.140.0070.01617.04
7.2.130.0080.01117.11
7.2.120.0030.01816.82
7.2.110.0070.01516.86
7.2.100.0070.01417.00
7.2.90.0020.01616.95
7.2.80.0030.01716.81
7.2.70.0100.01116.73
7.2.60.0040.01516.97
7.2.50.0060.01516.84
7.2.40.0110.01016.85
7.2.30.0040.01816.79
7.2.20.0030.01516.92
7.2.10.0100.01216.99
7.2.00.0100.01117.61
7.1.330.0050.01715.73
7.1.320.0050.02415.92
7.1.310.0050.02215.69
7.1.300.0050.02015.81
7.1.290.0030.02215.54
7.1.280.0050.01915.47
7.1.270.0040.02015.62
7.1.260.0050.02115.64
7.1.250.0050.02115.87
7.1.70.0090.00617.25
7.1.60.0170.01719.40
7.1.50.0070.01017.08
7.1.00.0030.03722.46
7.0.200.0030.01016.80
7.0.140.0070.07322.18
7.0.60.0030.09020.03
7.0.50.0030.06017.91
7.0.40.0100.08717.71
7.0.30.0000.05717.76
7.0.20.0100.07317.73
7.0.10.0030.06017.80
7.0.00.0030.09317.79
5.6.280.0030.08721.12
5.6.210.0030.09720.77
5.6.200.0100.09018.29
5.6.190.0070.09318.15
5.6.180.0070.07318.25
5.6.170.0030.06318.19
5.6.160.0070.08018.29
5.6.150.0070.09718.20
5.6.140.0070.09318.15
5.6.130.0170.08318.14
5.6.120.0070.07718.11
5.6.110.0130.08718.27
5.6.100.0100.09318.15
5.6.90.0030.08718.26
5.6.80.0030.05717.54
5.6.70.0070.09717.65
5.6.60.0000.08717.52
5.6.50.0070.06317.56
5.6.40.0100.08717.55
5.6.30.0030.04717.64
5.6.20.0100.04317.52
5.6.10.0130.08317.54
5.6.00.0070.05017.50
5.5.350.0170.07020.47
5.5.340.0070.08318.04
5.5.330.0170.08717.99
5.5.320.0070.09017.96
5.5.310.0100.09017.95
5.5.300.0030.08017.96
5.5.290.0130.09318.09
5.5.280.0130.08317.98
5.5.270.0200.08017.97
5.5.260.0070.09717.98
5.5.250.0130.04317.77
5.5.240.0000.06017.37
5.5.230.0100.06717.38
5.5.220.0070.08717.43
5.5.210.0030.09017.36
5.5.200.0100.05717.34
5.5.190.0070.09017.38
5.5.180.0130.05317.43
5.5.160.0030.06317.33
5.5.150.0100.07717.29
5.5.140.0100.08717.43
5.5.130.0170.07717.32
5.5.120.0130.08717.33
5.5.110.0070.06717.41
5.5.100.0100.08317.24
5.5.90.0130.08317.24
5.5.80.0000.05317.22
5.5.70.0100.09017.21
5.5.60.0070.07317.22
5.5.50.0130.08017.20
5.5.40.0030.09717.18
5.5.30.0070.06717.21
5.5.20.0070.09317.23
5.5.10.0030.09717.22
5.5.00.0000.09317.20
5.4.450.0130.09319.22
5.4.440.0070.09319.28
5.4.430.0130.09019.38
5.4.420.0030.10019.45
5.4.410.0130.08319.18
5.4.400.0100.07719.05
5.4.390.0100.08718.95
5.4.380.0070.08319.12
5.4.370.0100.06718.95
5.4.360.0100.08318.89
5.4.350.0070.05718.96
5.4.340.0030.06019.02
5.4.320.0130.08019.02
5.4.310.0030.07719.04
5.4.300.0170.08019.06
5.4.290.0030.08019.03
5.4.280.0030.09719.02
5.4.270.0130.07719.02
5.4.260.0070.08319.11
5.4.250.0070.09719.27
5.4.240.0100.08719.12
5.4.230.0130.07719.04
5.4.220.0070.05718.98
5.4.210.0070.08719.04
5.4.200.0100.08719.07
5.4.190.0130.08019.00
5.4.180.0030.08718.97
5.4.170.0070.06719.04
5.4.160.0100.06019.11
5.4.150.0100.09019.03
5.4.140.0170.08016.38
5.4.130.0100.09016.29
5.4.120.0070.08716.62
5.4.110.0100.08716.45
5.4.100.0070.05316.36
5.4.90.0070.08716.38
5.4.80.0070.08716.39
5.4.70.0000.07016.45
5.4.60.0070.05316.36
5.4.50.0200.07716.38
5.4.40.0000.05316.61
5.4.30.0100.04716.45
5.4.20.0070.05016.40
5.4.10.0100.04016.54
5.4.00.0000.04715.85
5.3.290.0030.05714.71
5.3.280.0070.10314.59
5.3.270.0070.07014.71
5.3.260.0070.10014.59
5.3.250.0070.09314.67
5.3.240.0030.07714.64
5.3.230.0070.09714.61
5.3.220.0130.06014.53
5.3.210.0100.09314.78
5.3.200.0100.09014.61
5.3.190.0070.08314.66
5.3.180.0070.09314.55
5.3.170.0130.06014.58
5.3.160.0130.08714.57
5.3.150.0070.09314.52
5.3.140.0030.09714.52
5.3.130.0030.06014.59
5.3.120.0000.10714.60
5.3.110.0030.08314.56
5.3.100.0000.05714.07
5.3.90.0100.09714.09
5.3.80.0100.06714.05
5.3.70.0130.07314.11
5.3.60.0030.06314.03
5.3.50.0100.09314.00
5.3.40.0000.06313.84
5.3.30.0030.08313.90
5.3.20.0100.07013.54
5.3.10.0070.06313.54
5.3.00.0000.05313.67
5.2.170.0100.08711.19
5.2.160.0070.06711.19
5.2.150.0030.07011.15
5.2.140.0030.08711.16
5.2.130.0100.08311.09
5.2.120.0030.08711.00
5.2.110.0030.08011.11
5.2.100.0070.08710.99
5.2.90.0030.05011.14
5.2.80.0000.05311.30
5.2.70.0000.06010.98
5.2.60.0030.08011.07
5.2.50.0000.06011.06
5.2.40.0030.06310.99
5.2.30.0070.09010.86
5.2.20.0100.08310.81
5.2.10.0000.05010.89
5.2.00.0070.09010.82
5.1.60.0030.0639.99
5.1.50.0000.05010.04
5.1.40.0030.0839.97
5.1.30.0070.08010.30
5.1.20.0070.08710.40
5.1.10.0030.05010.06
5.1.00.0070.08310.02
5.0.50.0000.0878.55
5.0.40.0030.1038.42
5.0.30.0030.1138.23
5.0.20.0070.1008.20
5.0.10.0000.0638.25
5.0.00.0070.1038.16
4.4.90.0000.0337.71
4.4.80.0030.0237.71
4.4.70.0000.0377.71
4.4.60.0000.0237.71
4.4.50.0000.0207.71
4.4.40.0000.0377.71
4.4.30.0000.0407.71
4.4.20.0000.0237.71
4.4.10.0000.0237.71
4.4.00.0000.0607.71
4.3.110.0030.0337.71
4.3.100.0030.0207.71
4.3.90.0070.0177.71
4.3.80.0000.0577.71
4.3.70.0000.0207.71
4.3.60.0070.0207.71
4.3.50.0030.0277.71
4.3.40.0000.0377.71
4.3.30.0000.0237.71
4.3.20.0000.0377.71
4.3.10.0000.0407.71
4.3.00.0000.0377.71

preferences:
32.64 ms | 401 KiB | 5 Q