3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function testFunction($arr) { array_walk_recursive($arr, array('Test','alt_json_encode_callback')); return mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); } static private function alt_json_encode_callback (&$item, $key) { if (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); } } $a= Test::testFunction(array('1','1')); var_dump($a);

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.0110.01118.55
8.3.50.0080.00822.11
8.3.40.0040.01118.97
8.3.30.0150.00019.21
8.3.20.0050.00220.33
8.3.10.0000.00921.86
8.3.00.0090.00022.37
8.2.180.0130.00616.47
8.2.170.0110.00722.96
8.2.160.0080.00621.00
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0070.01126.16
8.2.120.0080.00017.63
8.2.110.0080.00020.93
8.2.100.0090.00317.59
8.2.90.0040.00419.17
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0070.00017.80
8.2.50.0000.00818.07
8.2.40.0030.00619.34
8.2.30.0030.00517.82
8.2.20.0070.00017.68
8.2.10.0050.00217.61
8.2.00.0040.00419.52
8.1.280.0060.01225.92
8.1.270.0000.00821.95
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00321.28
8.1.230.0130.00817.42
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0000.00817.22
8.1.190.0060.00317.10
8.1.180.0080.00018.10
8.1.170.0040.00418.70
8.1.160.0030.00521.87
8.1.150.0000.00818.57
8.1.140.0000.00817.21
8.1.130.0000.00817.68
8.1.120.0000.00717.37
8.1.110.0040.00417.39
8.1.100.0000.00817.31
8.1.90.0030.00417.21
8.1.80.0030.00317.36
8.1.70.0040.00417.32
8.1.60.0000.00817.49
8.1.50.0080.00017.40
8.1.40.0000.00817.29
8.1.30.0080.00017.55
8.1.20.0080.00017.54
8.1.10.0000.00817.51
8.1.00.0030.00517.48
8.0.300.0020.00518.77
8.0.290.0040.00416.63
8.0.280.0030.00318.30
8.0.270.0000.00717.13
8.0.260.0000.00818.38
8.0.250.0070.00016.96
8.0.240.0000.00916.98
8.0.230.0070.00016.85
8.0.220.0050.00316.74
8.0.210.0060.00016.79
8.0.200.0070.00016.97
8.0.190.0030.00616.93
8.0.180.0080.00016.94
8.0.170.0040.00416.98
8.0.160.0000.00816.98
8.0.150.0030.00316.75
8.0.140.0000.00716.75
8.0.130.0030.00313.26
8.0.120.0040.00416.79
8.0.110.0000.00716.73
8.0.100.0030.00516.73
8.0.90.0070.00016.93
8.0.80.0040.01116.82
8.0.70.0070.00016.97
8.0.60.0080.00016.82
8.0.50.0000.00716.73
8.0.30.0120.00617.06
8.0.20.0120.01117.40
8.0.10.0000.00716.90
8.0.00.0070.01216.95
7.4.330.0050.00015.00
7.4.320.0030.00316.61
7.4.300.0000.00616.56
7.4.290.0030.00316.68
7.4.280.0050.00516.54
7.4.270.0070.00316.58
7.4.260.0000.00916.55
7.4.250.0040.00416.61
7.4.240.0020.00516.55
7.4.230.0030.00316.78
7.4.220.0110.00716.68
7.4.210.0070.00816.66
7.4.200.0030.00316.56
7.4.190.0030.00316.54
7.4.160.0170.00316.41
7.4.150.0070.01117.40
7.4.140.0110.01017.86
7.4.130.0070.01416.49
7.4.120.0130.00516.63
7.4.110.0070.01016.60
7.4.100.0040.01416.45
7.4.90.0060.01216.45
7.4.80.0100.00719.39
7.4.70.0110.00616.39
7.4.60.0060.01216.27
7.4.50.0050.00016.43
7.4.40.0080.00822.77
7.4.30.0160.00516.48
7.4.00.0100.00614.89
7.3.330.0060.00013.38
7.3.320.0020.00213.21
7.3.310.0030.00316.39
7.3.300.0070.00016.29
7.3.290.0100.01016.38
7.3.280.0090.00816.36
7.3.270.0040.01417.40
7.3.260.0030.01516.41
7.3.250.0060.01316.30
7.3.240.0100.00716.22
7.3.230.0080.00816.39
7.3.210.0130.00416.27
7.3.200.0140.01019.39
7.3.190.0160.00716.21
7.3.180.0150.00016.42
7.3.170.0120.00316.29
7.3.160.0030.01616.54
7.3.120.0070.01014.96
7.3.10.0170.00316.57
7.3.00.0140.00716.37
7.2.330.0140.00316.64
7.2.320.0070.01016.39
7.2.310.0140.00316.66
7.2.300.0030.01216.72
7.2.290.0070.01016.53
7.2.130.0130.00716.39
7.2.120.0100.01016.48
7.2.110.0090.00616.32
7.2.100.0140.00716.82
7.2.90.0120.00016.42
7.2.80.0110.00816.45
7.2.70.0190.00316.76
7.2.60.0080.00516.64
7.2.50.0210.00616.58
7.2.40.0130.01016.66
7.2.30.0080.00916.82
7.2.20.0070.01016.54
7.2.10.0060.01016.52
7.2.00.0040.00716.93
7.1.250.0060.01015.55
7.1.200.0070.00315.58
7.1.70.0030.00617.26
7.1.60.0100.01419.82
7.1.50.0100.01317.07
7.1.00.0000.08022.36
7.0.200.0000.01016.71
7.0.140.0000.07322.05
7.0.90.0500.07319.84
7.0.80.0600.08019.92
7.0.70.0470.05719.85
7.0.60.0530.08019.84
7.0.50.0470.07720.39
7.0.40.0100.07320.09
7.0.30.0100.08020.14
7.0.20.0130.07020.09
7.0.10.0070.08020.05
7.0.00.0100.03720.05
5.6.280.0030.07320.91
5.6.240.0100.08720.59
5.6.230.0070.05720.63
5.6.220.0030.09720.60
5.6.210.0000.05320.58
5.6.200.0070.08721.02
5.6.190.0030.05021.11
5.6.180.0070.08321.08
5.6.170.0070.08021.12
5.6.160.0130.07021.05
5.6.150.0200.06321.08
5.6.140.0030.07321.05
5.6.130.0070.04721.14
5.6.120.0230.04721.17
5.6.110.0030.05020.97
5.6.100.0070.09021.13
5.6.90.0100.07021.12
5.6.80.0130.07320.50
5.6.70.0170.06720.42
5.6.60.0030.07720.50
5.6.50.0100.04720.44
5.6.40.0100.08020.46
5.6.30.0000.04720.30
5.6.20.0030.06320.47
5.6.10.0030.05020.49
5.6.00.0030.08020.29
5.5.380.0070.08320.31
5.5.370.0230.06320.32
5.5.360.0070.07020.32
5.5.350.0070.04720.34
5.5.340.0070.04720.65
5.5.330.0100.07720.91
5.5.320.0000.08020.85
5.5.310.0100.08020.83
5.5.300.0100.08320.80
5.5.290.0100.04720.83
5.5.280.0030.08720.93
5.5.270.0130.04720.91
5.5.260.0130.08020.87
5.5.250.0170.07320.61
5.5.240.0000.08320.25
5.5.230.0100.07320.16
5.5.220.0070.07320.27
5.5.210.0030.07320.22
5.5.200.0130.06720.13
5.5.190.0030.08320.09
5.5.180.0130.07020.08
5.5.160.0070.07320.00
5.5.150.0100.07720.24
5.5.140.0100.04020.11
5.5.130.0070.04720.11
5.5.120.0030.07019.99
5.5.110.0030.06020.20
5.5.100.0030.06020.08
5.5.90.0100.03720.07
5.5.80.0030.06020.07
5.5.70.0000.05320.12
5.5.60.0100.04720.01
5.5.50.0030.03720.16
5.5.40.0030.04320.14
5.5.30.0030.04020.03
5.5.20.0030.04020.00
5.5.10.0170.04719.98
5.5.00.0070.03319.96
5.4.450.0070.08319.27
5.4.440.0100.04019.27
5.4.430.0070.06019.44
5.4.420.0130.06019.20
5.4.410.0030.08719.24
5.4.400.0070.07718.85
5.4.390.0100.04719.16
5.4.380.0070.07719.04
5.4.370.0170.07019.09
5.4.360.0130.07319.04
5.4.350.0200.05019.14
5.4.340.0000.05019.21
5.4.320.0030.08319.04
5.4.310.0100.04019.07
5.4.300.0100.07319.04
5.4.290.0070.05019.03
5.4.280.0000.04319.23
5.4.270.0030.06319.04
5.4.260.0000.04719.12
5.4.250.0030.04019.22
5.4.240.0030.03719.20
5.4.230.0170.03019.11
5.4.220.0100.03319.15
5.4.210.0000.04318.84
5.4.200.0030.03719.12
5.4.190.0000.03718.95
5.4.180.0070.03719.08
5.4.170.0030.08019.04
5.4.160.0000.05719.01
5.4.150.0100.06018.85
5.4.140.0100.06716.29
5.4.130.0030.07016.45
5.4.120.0000.07316.39
5.4.110.0030.04716.48
5.4.100.0030.03716.38
5.4.90.0030.03316.47
5.4.80.0200.03316.49
5.4.70.0000.05016.47
5.4.60.0000.03716.41
5.4.50.0000.04016.45
5.4.40.0030.04016.36
5.4.30.0030.03716.45
5.4.20.0100.03716.46
5.4.10.0070.03016.40
5.4.00.0030.03315.81
5.3.290.0030.07014.80
5.3.280.0130.03314.66
5.3.270.0070.03314.56
5.3.260.0000.08314.67
5.3.250.0000.04014.56
5.3.240.0100.05014.68
5.3.230.0030.05014.63
5.3.220.0030.03314.52
5.3.210.0070.07714.68
5.3.200.0000.04314.63
5.3.190.0000.06314.66
5.3.180.0070.03014.52
5.3.170.0000.04714.64
5.3.160.0100.03014.69
5.3.150.0030.03714.57
5.3.140.0030.04014.65
5.3.130.0000.05314.49
5.3.120.0030.03714.50
5.3.110.0030.03714.61
5.3.100.0030.03714.13
5.3.90.0030.03313.95
5.3.80.0030.05714.10
5.3.70.0030.05714.04
5.3.60.0000.06313.94
5.3.50.0070.02713.90
5.3.40.0000.03713.87
5.3.30.0070.04013.80
5.3.20.0030.03313.68
5.3.10.0030.05313.78
5.3.00.0000.03713.66
5.2.170.0000.03011.01
5.2.160.0000.02711.04
5.2.150.0070.02311.27
5.2.140.0070.03311.25
5.2.130.0100.02311.18
5.2.120.0030.02711.01
5.2.110.0000.04310.99
5.2.100.0000.03011.13
5.2.90.0000.03311.10
5.2.80.0000.02711.25
5.2.70.0000.03311.03
5.2.60.0000.03010.95
5.2.50.0030.03711.08
5.2.40.0000.03011.11
5.2.30.0030.02710.84
5.2.20.0030.02711.05
5.2.10.0000.02710.78
5.2.00.0000.03010.65
5.1.60.0030.0409.99
5.1.50.0000.0279.94
5.1.40.0070.02010.10
5.1.30.0000.02710.25
5.1.20.0000.05010.37
5.1.10.0100.05010.17
5.1.00.0070.0539.94
5.0.50.0030.0479.94
5.0.40.0030.0439.94
5.0.30.0070.0609.94
5.0.20.0030.0439.94
5.0.10.0030.0409.94
5.0.00.0070.0479.94
4.4.90.0000.0339.94
4.4.80.0000.0209.94
4.4.70.0000.0179.94
4.4.60.0030.0139.94
4.4.50.0030.0139.94
4.4.40.0030.0209.94
4.4.30.0000.0139.94
4.4.20.0000.0309.94
4.4.10.0000.0339.94
4.4.00.0000.0609.94
4.3.110.0000.0279.94
4.3.100.0070.0309.94
4.3.90.0070.0309.94
4.3.80.0070.0309.94
4.3.70.0100.0239.94
4.3.60.0070.0309.94
4.3.50.0070.0339.94
4.3.40.0070.0509.94
4.3.30.0000.0379.94
4.3.20.0000.0339.94
4.3.10.0000.0309.94
4.3.00.0030.0339.94

preferences:
38.25 ms | 401 KiB | 5 Q