3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $_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.0040.01514.95
7.3.120.0110.00714.65
7.3.110.0110.00714.83
7.3.100.0040.01114.77
7.3.90.0070.00714.97
7.3.80.0090.00614.84
7.3.70.0030.00714.52
7.3.60.0070.01114.70
7.3.50.0060.00314.87
7.3.40.0040.00814.91
7.3.30.0060.00314.64
7.3.20.0070.01116.73
7.3.10.0070.00716.31
7.3.00.0080.00816.59
7.2.250.0030.01414.82
7.2.240.0040.01114.68
7.2.230.0100.00315.11
7.2.220.0100.00314.96
7.2.210.0060.00614.99
7.2.200.0030.01014.97
7.2.190.0040.00715.08
7.2.180.0060.00315.16
7.2.170.0070.00715.15
7.1.330.0100.00315.73
7.1.320.0090.00315.70
7.1.310.0000.01315.53
7.1.300.0120.00315.75
7.1.290.0040.00715.78
7.1.280.0030.00915.45
7.1.270.0070.01015.70
7.1.260.0070.00715.86
7.1.70.0080.00017.05
7.1.60.0000.02419.82
7.1.50.0110.01416.84
7.1.00.0130.06722.28
7.0.200.0070.00316.71
7.0.140.0000.07321.97
7.0.60.0130.07719.96
7.0.50.0170.07017.88
7.0.40.0100.07720.14
7.0.30.0200.04020.24
7.0.20.0330.07320.19
7.0.10.0270.08020.25
7.0.00.0170.07720.10
5.6.280.0000.07720.90
5.6.210.0100.07720.51
5.6.200.0070.08318.18
5.6.190.0000.08020.62
5.6.180.3500.04320.64
5.6.170.0470.07320.39
5.6.160.0100.08020.43
5.6.150.0100.07718.19
5.6.140.0170.06318.14
5.6.130.0130.07318.25
5.6.120.0070.04021.13
5.6.110.0030.08320.95
5.6.100.0030.04021.04
5.6.90.0100.08721.13
5.6.80.0100.05020.51
5.6.70.4100.03320.50
5.5.350.0070.07720.38
5.5.340.0070.08017.96
5.5.330.0100.03320.13
5.5.320.0530.06720.34
5.5.310.0270.03720.30
5.5.300.0070.08018.04
5.5.290.0100.08017.95
5.5.280.0170.07320.88
5.5.270.0030.06020.74
5.5.260.0070.08320.76
5.5.250.0070.04320.79
5.5.240.0030.04320.07
5.4.450.0400.04719.48
5.4.440.0870.03719.27
5.4.430.0230.03319.58
5.4.420.0100.03319.32
5.4.410.0070.06718.81
5.4.400.0130.04718.54
5.4.390.0130.05018.59
5.4.380.0170.05318.54
5.4.370.0870.05018.84
5.4.360.0400.05018.63
5.4.350.0430.05318.79
5.4.340.0270.05318.63
5.4.320.0080.04312.50
5.4.310.0100.04412.50
5.4.300.0080.03412.50
5.4.290.0050.04012.49
5.4.280.0060.04212.39
5.4.270.0060.04012.39
5.4.260.0100.03812.39
5.4.250.0070.04212.39
5.4.240.0090.04112.39
5.4.230.0030.04912.39
5.4.220.0070.03412.39
5.4.210.0060.03812.39
5.4.200.0090.03812.39
5.4.190.0050.03712.38
5.4.180.0060.04412.38
5.4.170.0170.04212.38
5.4.160.0280.09212.37
5.4.150.0240.09512.37
5.4.140.0130.04412.05
5.4.130.0090.04912.04
5.4.120.0140.04212.00
5.4.110.0160.04011.99
5.4.100.0170.04011.99
5.4.90.0140.04311.99
5.4.80.0140.04311.99
5.4.70.0180.03811.99
5.4.60.0140.04211.99
5.4.50.0240.09311.98
5.4.40.0170.03911.97
5.4.30.0170.04011.97
5.4.20.0140.04211.97
5.4.10.0210.06611.97
5.4.00.0170.03911.46
5.3.290.0060.04612.80
5.3.280.0080.03812.71
5.3.270.0130.04712.72
5.3.260.0170.04312.71
5.3.250.0200.03912.72
5.3.240.0150.04412.72
5.3.230.0120.04912.71
5.3.220.0330.05712.68
5.3.210.0140.04612.68
5.3.200.0120.04712.68
5.3.190.0150.04712.68
5.3.180.0140.04612.68
5.3.170.0160.10512.67
5.3.160.0170.04312.67
5.3.150.0150.04512.67
5.3.140.0180.04112.66
5.3.130.0150.04512.66
5.3.120.0120.04812.66
5.3.110.0170.04212.66
5.3.100.0150.04512.12
5.3.90.0160.04112.10
5.3.80.0170.04212.08
5.3.70.0210.06812.08
5.3.60.0180.04112.07
5.3.50.0120.04612.02
5.3.40.0170.04112.02
5.3.30.0190.03811.98
5.3.20.0130.04411.77
5.3.10.0110.04411.73
5.3.00.0170.04111.71
5.2.170.0140.0349.21
5.2.160.0130.0639.21
5.2.150.0200.0579.21
5.2.140.0120.0359.21
5.2.130.0140.0319.18
5.2.120.0110.0349.17
5.2.110.0090.0399.18
5.2.100.0120.0359.18
5.2.90.0150.0319.17
5.2.80.0150.0319.16
5.2.70.0190.0289.16
5.2.60.0090.0389.12
5.2.50.0320.0759.09
5.2.40.0120.0349.06
5.2.30.0130.0339.04
5.2.20.0110.0369.04
5.2.10.0130.0338.95
5.2.00.0150.0308.79
5.1.60.0060.0338.09
5.1.50.0110.0298.08
5.1.40.0090.0308.07
5.1.30.0220.0538.41
5.1.20.0140.0298.44
5.1.10.0110.0328.16
5.1.00.0120.0298.16
5.0.50.0110.0226.65
5.0.40.0100.0216.51
5.0.30.0120.0326.32
5.0.20.0080.0236.29
5.0.10.0070.0246.27
5.0.00.0080.0366.26
4.4.90.0060.0194.78
4.4.80.0100.0154.75
4.4.70.0050.0204.75
4.4.60.0100.0154.76
4.4.50.0060.0194.77
4.4.40.0130.0534.71
4.4.30.0050.0204.76
4.4.20.0060.0184.84
4.4.10.0040.0204.85
4.4.00.0060.0294.76
4.3.110.0080.0184.67
4.3.100.0080.0164.66
4.3.90.0170.0374.63
4.3.80.0040.0304.58
4.3.70.0090.0144.63
4.3.60.0070.0164.63
4.3.50.0050.0194.63
4.3.40.0070.0274.54
4.3.30.0070.0163.30
4.3.20.0070.0163.30
4.3.10.0050.0203.25
4.3.00.0030.01713.04

preferences:
39.3 ms | 401 KiB | 5 Q