3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { var $myarray; function add($x) { $this->myarray[] = $x; } } $foo = new foo(); function a($x) { global $foo; $foo->add($x); } function b($x) { $GLOBALS['foo']->add($x); } a("hiya"); b("howdy"); print_r($foo->myarray);

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.0000.01518.55
8.3.50.0110.00621.14
8.3.40.0110.00318.76
8.3.30.0070.00720.27
8.3.20.0050.00320.41
8.3.10.0040.00420.79
8.3.00.0060.00323.53
8.2.180.0140.00716.50
8.2.170.0070.01322.96
8.2.160.0070.01020.39
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00021.13
8.2.110.0100.00019.45
8.2.100.0040.00817.71
8.2.90.0070.00019.26
8.2.80.0080.00017.97
8.2.70.0000.00817.50
8.2.60.0000.00918.05
8.2.50.0060.00318.07
8.2.40.0050.00318.33
8.2.30.0080.00019.31
8.2.20.0040.00417.78
8.2.10.0020.00517.61
8.2.00.0030.00617.80
8.1.280.0070.00725.92
8.1.270.0110.00723.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.60
8.1.230.0070.00420.96
8.1.220.0000.00818.77
8.1.210.0040.00418.94
8.1.200.0050.00517.47
8.1.190.0040.00417.52
8.1.180.0080.00018.10
8.1.170.0040.00418.64
8.1.160.0050.00318.88
8.1.150.0000.00718.63
8.1.140.0000.00717.44
8.1.130.0030.00317.77
8.1.120.0050.00317.44
8.1.110.0040.00417.43
8.1.100.0030.00617.46
8.1.90.0000.00717.33
8.1.80.0000.00717.45
8.1.70.0000.00817.38
8.1.60.0030.00517.60
8.1.50.0070.00017.48
8.1.40.0030.00617.48
8.1.30.0000.00817.68
8.1.20.0000.00817.66
8.1.10.0000.00917.46
8.1.00.0030.00517.43
8.0.300.0080.00019.73
8.0.290.0020.00517.18
8.0.280.0040.00418.42
8.0.270.0030.00317.31
8.0.260.0070.00416.68
8.0.250.0000.00716.88
8.0.240.0000.00916.92
8.0.230.0030.00316.90
8.0.220.0000.00716.89
8.0.210.0000.00716.91
8.0.200.0000.00716.87
8.0.190.0000.00816.93
8.0.180.0040.00416.90
8.0.170.0070.00016.88
8.0.160.0080.00016.85
8.0.150.0040.00416.95
8.0.140.0000.00716.84
8.0.130.0000.00613.28
8.0.120.0060.00316.89
8.0.110.0070.00016.75
8.0.100.0000.00716.76
8.0.90.0000.00716.79
8.0.80.0070.00716.95
8.0.70.0000.00816.96
8.0.60.0000.00716.87
8.0.50.0000.00716.88
8.0.30.0140.00816.99
8.0.20.0140.00517.41
8.0.10.0000.00817.05
8.0.00.0060.01416.62
7.4.330.0070.00016.72
7.4.320.0030.00316.50
7.4.300.0030.00316.53
7.4.290.0000.00716.39
7.4.280.0060.00016.61
7.4.270.0030.00316.61
7.4.260.0000.00513.38
7.4.250.0040.00416.52
7.4.240.0040.00416.49
7.4.230.0050.00216.29
7.4.220.0150.00316.59
7.4.210.0060.01016.61
7.4.200.0000.00716.59
7.4.190.0050.00216.46
7.4.160.0120.00416.50
7.4.150.0070.01117.40
7.4.140.0100.00717.86
7.4.130.0080.01516.54
7.4.120.0090.01116.55
7.4.110.0100.00716.63
7.4.100.0090.00916.28
7.4.90.0100.01416.42
7.4.80.0140.01019.39
7.4.70.0070.01016.38
7.4.60.0160.00316.50
7.4.50.0040.00416.19
7.4.40.0050.00522.77
7.4.30.0180.00316.25
7.4.00.0040.00815.10
7.3.330.0000.00513.17
7.3.320.0060.00013.21
7.3.310.0030.00316.40
7.3.300.0000.00916.24
7.3.290.0060.01116.38
7.3.280.0070.00816.39
7.3.270.0130.01017.40
7.3.260.0130.00518.24
7.3.250.0080.00816.29
7.3.240.0140.00416.55
7.3.230.0150.00316.58
7.3.210.0070.01016.52
7.3.200.0140.00819.39
7.3.190.0080.00916.49
7.3.180.0130.00316.42
7.3.170.0100.00616.28
7.3.160.0060.01516.48
7.3.120.0080.00814.84
7.3.10.0060.00916.39
7.3.00.0090.00416.63
7.2.330.0070.01116.45
7.2.320.0030.01616.55
7.2.310.0110.00816.55
7.2.300.0110.00716.69
7.2.290.0060.01116.32
7.2.130.0040.01216.90
7.2.120.0090.00416.75
7.2.110.0070.00716.73
7.2.100.0070.00716.78
7.2.90.0100.00316.76
7.2.80.0040.00916.67
7.2.70.0080.00716.79
7.2.60.0060.00816.90
7.2.50.0050.00516.87
7.2.40.0050.01016.79
7.2.30.0100.00416.87
7.2.20.0060.00716.98
7.2.10.0090.00316.83
7.2.00.0090.00516.88
7.1.250.0070.00715.89
7.1.240.0040.01115.89
7.1.230.0000.00916.02
7.1.220.0060.00615.90
7.1.210.0090.00015.78
7.1.200.0100.00315.91
7.1.190.0040.00415.85
7.1.180.0070.00715.71
7.1.170.0060.00915.76
7.1.160.0050.00515.89
7.1.150.0090.00315.77
7.1.140.0040.00815.91
7.1.130.0000.01315.73
7.1.120.0000.01315.87
7.1.110.0040.01115.76
7.1.100.0000.01115.75
7.1.90.0070.00415.94
7.1.80.0070.00715.89
7.1.70.0020.00616.28
7.1.60.0060.00917.50
7.1.50.0050.01216.32
7.1.40.0090.00015.76
7.1.30.0030.00715.96
7.1.20.0090.00915.70
7.1.10.0070.00715.89
7.1.00.0020.02619.21
7.0.330.0100.00315.44
7.0.320.0030.00515.50
7.0.310.0030.00615.45
7.0.300.0000.01115.46
7.0.290.0000.00815.58
7.0.280.0000.01615.46
7.0.270.0100.00315.44
7.0.260.0090.00015.44
7.0.250.0090.00315.45
7.0.240.0030.00715.52
7.0.230.0070.00715.19
7.0.220.0030.00715.57
7.0.210.0070.00715.50
7.0.200.0040.00716.11
7.0.190.0100.00315.18
7.0.180.0040.00915.42
7.0.170.0060.00915.26
7.0.160.0030.00615.30
7.0.150.0090.00015.45
7.0.140.0040.04018.73
7.0.130.0040.00715.52
7.0.120.0000.01215.16
7.0.110.0060.00615.26
7.0.100.0080.04117.75
7.0.90.0090.03317.69
7.0.80.0100.04617.73
7.0.70.0070.04517.66
7.0.60.0070.03417.66
7.0.50.0010.04417.94
7.0.40.0050.04416.74
7.0.30.0050.03216.78
7.0.20.0070.04216.79
7.0.10.0050.04416.66
7.0.00.0040.03216.72
5.6.380.0070.00314.22
5.6.370.0030.00914.70
5.6.360.0050.00514.53
5.6.350.0030.01014.57
5.6.340.0120.00614.68
5.6.330.0050.00314.11
5.6.320.0070.00414.37
5.6.310.0030.01014.04
5.6.300.0000.01314.43
5.6.290.0070.00714.46
5.6.280.0040.03817.83
5.6.270.0090.00314.60
5.6.260.0030.00614.43
5.6.250.0050.03717.45
5.6.240.0120.04517.51
5.6.230.0100.03917.58
5.6.220.0040.03417.48
5.6.210.0030.02817.53
5.6.200.0100.04017.68
5.6.190.0070.04517.61
5.6.180.0050.04317.73
5.6.170.0020.04317.75
5.6.160.0060.02617.75
5.6.150.0030.03517.75
5.6.140.0030.04717.67
5.6.130.0030.04417.71
5.6.120.0000.05417.77
5.6.110.0080.04717.76
5.6.100.0070.04417.59
5.6.90.0070.04017.68
5.6.80.0050.04217.32
5.6.70.0100.03117.33
5.6.60.0070.04317.32
5.6.50.0050.04517.35
5.6.40.0140.03917.46
5.6.30.0040.04417.41
5.6.20.0020.04517.45
5.6.10.0050.04517.42
5.6.00.0050.04317.24
5.5.380.0040.03915.81
5.5.370.0100.03315.79
5.5.360.0100.04015.96
5.5.350.0050.05016.01
5.5.340.0020.04816.15
5.5.330.0100.03316.20
5.5.320.0090.03315.92
5.5.310.0030.03516.24
5.5.300.0050.03816.17
5.5.290.0040.03916.13
5.5.280.0110.04015.79
5.5.270.0070.03715.88
5.5.260.0080.02016.09
5.5.250.0020.04515.89
5.5.240.0000.04515.83
5.5.230.0050.03915.68
5.5.220.0020.04815.71
5.5.210.0080.02515.81
5.5.200.0090.03815.75
5.5.190.0070.04215.84
5.5.180.0090.03315.74
5.5.170.0000.01111.10
5.5.160.0080.02015.76
5.5.150.0050.03015.77
5.5.140.0070.03715.69
5.5.130.0150.03315.68
5.5.120.0100.02515.66
5.5.110.0070.04515.71
5.5.100.0070.04215.63
5.5.90.0060.03515.53
5.5.80.0060.04115.60
5.5.70.0120.03315.71
5.5.60.0080.04315.74
5.5.50.0090.04115.61
5.5.40.0030.04415.73
5.5.30.0000.04915.54
5.5.20.0080.03515.64
5.5.10.0080.04115.72
5.5.00.0050.04115.63
5.4.450.0070.02515.23
5.4.440.0070.03815.28
5.4.430.0100.02715.34
5.4.420.0060.02115.33
5.4.410.0020.04315.22
5.4.400.0050.02015.08
5.4.390.0050.03015.04
5.4.380.0050.03815.12
5.4.370.0050.03015.14
5.4.360.0050.02215.06
5.4.350.0030.03115.07
5.4.340.0030.02715.08
5.4.330.0060.00610.85
5.4.320.0070.04215.22
5.4.310.0030.04215.03
5.4.300.0020.03915.09
5.4.290.0100.02814.87
5.4.280.0120.03515.12
5.4.270.0060.03915.13
5.4.260.0050.02515.05
5.4.250.0130.03515.20
5.4.240.0070.03015.14
5.4.230.0050.04115.05
5.4.220.0050.03515.03
5.4.210.0140.03214.99
5.4.200.0060.03114.98
5.4.190.0050.03615.07
5.4.180.0040.04715.07
5.4.170.0000.04615.12
5.4.160.0050.04215.17
5.4.150.0100.03014.97
5.4.140.0030.03813.70
5.4.130.0030.04313.66
5.4.120.0100.03013.62
5.4.110.0120.02013.78
5.4.100.0080.03213.75
5.4.90.0030.03013.78
5.4.80.0030.02213.86
5.4.70.0020.02313.90
5.4.60.0100.01813.70
5.4.50.0040.04113.74
5.4.40.0030.03813.81
5.4.30.0020.03513.80
5.4.20.0050.02313.75
5.4.10.0030.03313.66
5.4.00.0030.04313.40
5.3.290.0100.03813.19
5.3.280.0050.03813.06
5.3.270.0040.03413.24
5.3.260.0020.03213.20
5.3.250.0120.03213.15
5.3.240.0110.01813.11
5.3.230.0050.03913.16
5.3.220.0080.04013.04
5.3.210.0050.03813.14
5.3.200.0050.02813.06
5.3.190.0050.03913.10
5.3.180.0050.02313.21
5.3.170.0030.03513.27
5.3.160.0070.03913.13
5.3.150.0090.03513.24
5.3.140.0030.02613.21
5.3.130.0080.04013.24
5.3.120.0100.02413.21
5.3.110.0110.03513.19
5.3.100.0110.03713.15
5.3.90.0050.02713.15
5.3.80.0100.03513.14
5.3.70.0050.03913.14
5.3.60.0060.02813.03
5.3.50.0020.04613.07
5.3.40.0030.03913.15
5.3.30.0030.03813.16
5.3.20.0070.03813.17
5.3.10.0050.03413.00
5.3.00.0050.03412.96
5.2.170.0030.02812.85
5.2.160.0080.02212.85
5.2.150.0100.03012.85
5.2.140.0030.03512.85
5.2.130.0050.03212.85
5.2.120.0060.03212.85
5.2.110.0070.03012.85
5.2.100.0050.02612.85
5.2.90.0050.03312.85
5.2.80.0050.03312.85
5.2.70.0050.03012.85
5.2.60.0000.03012.85
5.2.50.0020.03512.85
5.2.40.0080.03012.85
5.2.30.0080.03012.85
5.2.20.0000.02512.85
5.2.10.0000.03412.85
5.2.00.0050.02712.85
5.1.60.0050.02512.85
5.1.50.0040.01512.85
5.1.40.0100.02312.85
5.1.30.0030.01812.85
5.1.20.0050.02712.85
5.1.10.0020.03012.85
5.1.00.0100.02512.85
5.0.50.0110.01712.85
5.0.40.0050.02312.85
5.0.30.0030.03512.85
5.0.20.0050.02012.85
5.0.10.0030.01912.85
5.0.00.0000.03612.85
4.4.90.0030.02112.85
4.4.80.0030.02012.85
4.4.70.0020.01812.85
4.4.60.0000.02412.85
4.4.50.0000.01612.85
4.4.40.0020.02012.85
4.4.30.0020.02012.85
4.4.20.0020.01912.85
4.4.10.0030.01012.85
4.4.00.0020.02512.85
4.3.110.0050.01712.85
4.3.100.0000.01512.85
4.3.90.0030.01512.85
4.3.80.0000.02612.85
4.3.70.0030.01812.85
4.3.60.0030.01112.85
4.3.50.0020.01512.85
4.3.40.0040.02512.85
4.3.30.0020.01712.85
4.3.20.0020.01212.85
4.3.10.0030.00912.85
4.3.00.0000.01912.85

preferences:
58.87 ms | 401 KiB | 5 Q