3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = json_decode('{"3":{"friend":45,"all":100},"2":{"friend":30,"all":50},"1":{"friend":25,"all":25}}'); $b = (array) $a; $n = '3'; var_dump($b); var_dump($b["3"]);

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0060.00316.62
7.3.00.0110.00416.67
7.2.130.0060.00316.89
7.2.120.0120.00316.73
7.2.110.0110.01116.55
7.2.100.0130.00616.75
7.2.90.0160.00316.68
7.2.80.0100.00716.82
7.2.70.0090.00916.43
7.2.60.0090.00616.69
7.2.50.0030.01016.66
7.2.40.0110.00416.76
7.2.30.0040.00716.46
7.2.20.0070.01116.53
7.2.10.0060.01016.86
7.2.00.0060.00618.12
7.1.250.0060.00315.77
7.1.240.0030.01115.46
7.1.230.0030.00915.77
7.1.220.0070.00715.79
7.1.210.0110.00715.60
7.1.200.0060.00815.83
7.1.190.0140.00315.87
7.1.180.0000.01515.47
7.1.170.0000.00815.72
7.1.160.0030.01215.41
7.1.150.0030.00915.63
7.1.140.0040.01115.46
7.1.130.0040.00815.73
7.1.120.0100.00715.61
7.1.110.0170.00015.89
7.1.100.0070.00716.96
7.1.90.0030.01315.81
7.1.80.0130.00715.74
7.1.70.0090.00316.61
7.1.60.0120.00917.84
7.1.50.0090.00816.34
7.1.40.0100.00715.80
7.1.30.0140.00715.79
7.1.20.0180.00015.71
7.1.10.0100.00315.50
7.1.00.0050.02719.24
7.0.330.0070.00715.22
7.0.320.0190.00515.40
7.0.310.0070.01115.32
7.0.300.0060.00315.07
7.0.290.0100.00615.14
7.0.280.0130.00315.01
7.0.270.0070.01015.12
7.0.260.0120.00315.11
7.0.250.0030.00615.25
7.0.240.0040.01115.18
7.0.230.0160.00815.40
7.0.220.0170.00315.23
7.0.210.0100.01015.34
7.0.200.0100.00515.90
7.0.190.0040.01215.28
7.0.180.0000.01515.18
7.0.170.0110.00715.27
7.0.160.0110.00415.08
7.0.150.0070.00415.17
7.0.140.0100.03518.66
7.0.130.0030.01314.95
7.0.120.0090.00315.55
7.0.110.0130.01015.33
7.0.100.0090.02217.60
7.0.90.0000.02817.67
7.0.80.0060.02317.39
7.0.70.0080.02017.56
7.0.60.0120.01817.71
7.0.50.0060.02517.87
7.0.40.0040.02316.76
7.0.30.0100.01716.69
7.0.20.0030.02116.71
7.0.10.0120.03016.84
7.0.00.0060.02316.68
5.6.380.0060.01014.43
5.6.370.0070.01114.34
5.6.360.0030.00614.16
5.6.350.0100.00714.18
5.6.340.0090.00314.27
5.6.330.0000.01614.23
5.6.320.0110.00713.81
5.6.310.0000.01614.50
5.6.300.0040.00814.07
5.6.290.0060.01014.29
5.6.280.0040.04317.60
5.6.270.0040.00714.10
5.6.260.0070.01113.97
5.6.250.0070.02217.49
5.6.240.0040.02517.29
5.6.230.0080.02317.20
5.6.220.0050.02117.24
5.6.210.0100.01817.28
5.6.200.0030.02317.54
5.6.190.0110.01517.65
5.6.180.0030.02317.56
5.6.170.0000.03317.46
5.6.160.0060.02117.43
5.6.150.0070.02417.51
5.6.140.0060.04417.43
5.6.130.0050.03017.53
5.6.120.0100.04317.56
5.6.110.0050.03117.63
5.6.100.0090.04017.41
5.6.90.0050.02417.54
5.6.80.0100.02317.06
5.6.70.0120.03317.25
5.6.60.0050.02717.18
5.6.50.0080.04217.22
5.6.40.0080.04317.21
5.6.30.0150.02317.12
5.6.20.0030.04017.19
5.6.10.0050.04517.20
5.6.00.0090.03717.13
5.5.380.0030.02315.63
5.5.370.0000.02415.55
5.5.360.0120.01815.53
5.5.350.0030.02115.56
5.5.340.0030.02215.92
5.5.330.0050.02015.82
5.5.320.0050.02015.86
5.5.310.0050.02015.77
5.5.300.0100.01515.88
5.5.290.0050.04215.75
5.5.280.0050.02715.86
5.5.270.0100.02415.69
5.5.260.0070.03515.75
5.5.250.0080.04115.76
5.5.240.0050.02215.43
5.5.230.0070.03915.57
5.5.220.0050.04015.42
5.5.210.0090.03715.55
5.5.200.0030.03815.40
5.5.190.0090.03815.47
5.5.180.0050.03615.49
5.5.170.0030.00910.87
5.5.160.0040.02315.43
5.5.150.0030.04615.36
5.5.140.0090.03715.49
5.5.130.0060.04315.55
5.5.120.0020.02915.60
5.5.110.0080.03615.53
5.5.100.0050.03515.51
5.5.90.0050.02815.37
5.5.80.0020.03615.42
5.5.70.0070.03315.43
5.5.60.0080.03815.59
5.5.50.0060.04015.60
5.5.40.0130.02815.52
5.5.30.0060.03315.37
5.5.20.0050.02315.50
5.5.10.0060.04115.43
5.5.00.0030.02315.47
5.4.450.0030.04515.08
5.4.440.0050.03614.98
5.4.430.0100.03815.10
5.4.420.0070.02215.25
5.4.410.0120.01715.11
5.4.400.0020.02714.84
5.4.390.0080.03715.05
5.4.380.0080.03414.88
5.4.370.0080.04214.88
5.4.360.0030.03514.91
5.4.350.0070.04015.01
5.4.340.0020.04014.88
5.4.330.0000.01010.81
5.4.320.0060.03314.85
5.4.310.0030.02214.85
5.4.300.0040.04115.04
5.4.290.0080.03614.66
5.4.280.0050.02214.96
5.4.270.0060.01914.79
5.4.260.0080.02814.91
5.4.250.0050.04514.94
5.4.240.0050.04314.85
5.4.230.0090.03514.98
5.4.220.0030.03414.94
5.4.210.0100.01814.86
5.4.200.0070.04114.91
5.4.190.0020.04614.90
5.4.180.0050.01815.01
5.4.170.0060.04114.75
5.4.160.0050.03514.95
5.4.150.0050.04014.80
5.4.140.0050.02413.62
5.4.130.0040.02113.74
5.4.120.0050.03813.59
5.4.110.0070.03713.70
5.4.100.0020.04213.48
5.4.90.0030.02813.60
5.4.80.0050.03613.50
5.4.70.0090.03013.59
5.4.60.0020.02413.71
5.4.50.0050.04013.64
5.4.40.0060.03313.55
5.4.30.0040.01813.48
5.4.20.0030.04313.67
5.4.10.0080.03513.48
5.4.00.0030.02913.32
5.3.290.0090.03112.54
5.3.280.0030.02712.52
5.3.270.0070.03812.55
5.3.260.0130.03012.59
5.3.250.0040.04312.56
5.3.240.0100.03312.52
5.3.230.0050.03612.47
5.3.220.0050.04212.45
5.3.210.0060.03512.49
5.3.200.0060.03312.44
5.3.190.0050.03812.43
5.3.180.0080.03512.52
5.3.170.0070.03012.57
5.3.160.0050.02312.50
5.3.150.0100.02212.52
5.3.140.0070.04012.45
5.3.130.0090.03512.52
5.3.120.0160.02212.51
5.3.110.0070.02312.44
5.3.100.0060.04512.21
5.3.90.0030.03812.24
5.3.80.0080.02412.13
5.3.70.0050.03912.18
5.3.60.0050.03812.21
5.3.50.0070.02012.21
5.3.40.0000.04612.19
5.3.30.0050.03112.19
5.3.20.0030.04712.01
5.3.10.0080.02711.99
5.3.00.0000.03711.94
5.2.170.0070.03210.83
5.2.160.0080.03310.81
5.2.150.0030.03310.82
5.2.140.0060.03210.81
5.2.130.0090.03010.79
5.2.120.0050.03110.79
5.2.110.0050.01810.77
5.2.100.0030.02210.70
5.2.90.0060.01810.82
5.2.80.0040.01810.68
5.2.70.0030.01610.78
5.2.60.0040.03310.74
5.2.50.0050.03010.76
5.2.40.0030.01810.65
5.2.30.0050.02510.74
5.2.20.0070.03310.73
5.2.10.0060.03110.70
5.2.00.0050.01610.62
5.1.60.0040.02610.24
5.1.50.0020.03010.25
5.1.40.0050.01610.25
5.1.30.0030.01710.42
5.1.20.0030.02310.43
5.1.10.0050.01610.24
5.1.00.0020.02610.24
5.0.50.0000.02710.24
5.0.40.0030.01310.24
5.0.30.0020.01810.24
5.0.20.0050.01910.24
5.0.10.0030.02010.24
5.0.00.0000.02010.24
4.4.90.0020.01210.24
4.4.80.0030.01010.24
4.4.70.0040.01810.24
4.4.60.0010.02010.24
4.4.50.0070.01310.24
4.4.40.0030.02810.24
4.4.30.0020.01710.24
4.4.20.0030.02110.24
4.4.10.0030.02210.24
4.4.00.0020.02210.24
4.3.110.0030.00810.24
4.3.100.0030.01310.24
4.3.90.0030.00810.24
4.3.80.0030.02710.24
4.3.70.0050.01710.24
4.3.60.0050.01310.24
4.3.50.0020.01110.24
4.3.40.0030.02510.24
4.3.30.0030.01510.24
4.3.20.0020.01710.24
4.3.10.0050.01310.24
4.3.00.0040.01210.24