3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { static 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.0140.00318.30
8.3.50.0120.00321.93
8.3.40.0040.01118.59
8.3.30.0070.00718.96
8.3.20.0000.00720.29
8.3.10.0080.00022.01
8.3.00.0040.00422.39
8.2.180.0150.00316.38
8.2.170.0000.01422.96
8.2.160.0070.01020.83
8.2.150.0000.00824.18
8.2.140.0000.00924.66
8.2.130.0110.00426.16
8.2.120.0060.00319.36
8.2.110.0030.01222.15
8.2.100.0120.00017.84
8.2.90.0000.00819.17
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0060.00318.04
8.2.50.0050.00318.10
8.2.40.0000.00920.18
8.2.30.0040.00417.91
8.2.20.0040.00417.66
8.2.10.0040.00417.63
8.2.00.0000.00717.61
8.1.280.0140.00725.92
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0070.00728.09
8.1.240.0060.00323.84
8.1.230.0040.00822.50
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0040.00717.35
8.1.190.0030.00517.23
8.1.180.0060.00318.10
8.1.170.0030.00718.71
8.1.160.0070.00022.06
8.1.150.0080.00018.56
8.1.140.0030.00517.43
8.1.130.0030.00317.82
8.1.120.0040.00417.48
8.1.110.0070.00017.41
8.1.100.0000.00717.49
8.1.90.0040.00417.50
8.1.80.0030.00317.46
8.1.70.0030.00317.35
8.1.60.0000.00817.65
8.1.50.0000.00817.48
8.1.40.0000.00717.59
8.1.30.0040.00417.55
8.1.20.0000.00917.63
8.1.10.0040.00417.61
8.1.00.0040.00417.64
8.0.300.0070.00018.77
8.0.290.0000.00816.60
8.0.280.0050.00218.37
8.0.270.0030.00317.30
8.0.260.0000.00716.93
8.0.250.0030.00316.85
8.0.240.0000.00717.00
8.0.230.0000.00716.92
8.0.220.0040.00416.83
8.0.210.0000.00716.93
8.0.200.0030.00316.82
8.0.190.0080.00016.83
8.0.180.0070.00016.81
8.0.170.0050.00316.88
8.0.160.0000.00716.96
8.0.150.0030.00316.82
8.0.140.0040.00416.91
8.0.130.0060.00013.30
8.0.120.0000.00816.86
8.0.110.0050.00216.72
8.0.100.0070.00016.75
8.0.90.0070.00016.89
8.0.80.0160.00616.93
8.0.70.0030.00516.79
8.0.60.0070.00016.79
8.0.50.0070.00016.73
8.0.30.0130.00617.24
8.0.20.0080.01117.40
8.0.10.0000.00716.85
8.0.00.0100.01316.65
7.4.330.0030.00315.08
7.4.320.0000.00616.65
7.4.300.0000.00616.66
7.4.290.0000.00716.69
7.4.280.0060.00316.45
7.4.270.0030.00716.55
7.4.260.0040.00416.54
7.4.250.0040.00416.52
7.4.240.0030.00516.64
7.4.230.0000.00716.77
7.4.220.0160.00916.58
7.4.210.0060.01016.67
7.4.200.0070.00016.59
7.4.190.0040.00416.75
7.4.160.0080.00816.40
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0100.01116.47
7.4.120.0060.01016.52
7.4.110.0100.00716.49
7.4.100.0120.01216.70
7.4.90.0140.00316.54
7.4.80.0160.00319.39
7.4.70.0060.01516.57
7.4.60.0040.01216.36
7.4.50.0000.00716.58
7.4.40.0040.01222.77
7.4.30.0100.01416.40
7.4.00.0100.00314.85
7.3.330.0000.00613.16
7.3.320.0000.00513.27
7.3.310.0000.00716.39
7.3.300.0030.00316.26
7.3.290.0060.01016.29
7.3.280.0070.00916.30
7.3.270.0110.00717.40
7.3.260.0100.00716.49
7.3.250.0130.00616.56
7.3.240.0060.01216.28
7.3.230.0070.01016.50
7.3.210.0090.00616.34
7.3.200.0080.00819.39
7.3.190.0120.01216.22
7.3.180.0090.00616.05
7.3.170.0130.00616.50
7.3.160.0040.01216.09
7.3.120.0030.01414.92
7.2.330.0070.01116.65
7.2.320.0040.01416.41
7.2.310.0070.01016.72
7.2.300.0100.00616.79
7.2.290.0080.00816.60
7.2.00.0030.01019.36
7.1.100.0040.00817.86
7.1.70.0070.00017.26
7.1.60.0100.01419.82
7.1.50.0030.00917.07
7.1.00.0070.07322.33
7.0.200.0080.00016.69
7.0.140.0000.07721.95
7.0.90.0200.07319.97
7.0.80.0100.04319.95
7.0.70.0100.08319.94
7.0.60.0170.07319.93
7.0.50.0030.09020.40
7.0.40.0170.07320.15
7.0.30.0100.08720.15
7.0.20.0170.07719.94
7.0.10.0100.06719.99
7.0.00.0000.09020.12
5.6.280.0070.07020.90
5.6.240.0170.07720.64
5.6.230.0070.08320.75
5.6.220.0200.07020.67
5.6.210.0100.07720.68
5.6.200.0070.09021.14
5.6.190.0100.04321.03
5.6.180.0030.07721.04
5.6.170.0200.06720.96
5.6.160.0130.07721.04
5.6.150.0100.04321.05
5.6.140.0030.04721.06
5.6.130.0030.08321.10
5.6.120.0070.05721.05
5.6.110.0230.07021.04
5.6.100.0100.07321.07
5.6.90.0070.07720.99
5.6.80.0070.07720.38
5.6.70.0230.03320.49
5.6.60.0000.05020.45
5.6.50.0100.07020.45
5.6.40.0130.03320.41
5.6.30.0070.03720.28
5.6.20.0030.04020.31
5.6.10.0100.07720.39
5.6.00.0100.07020.30
5.5.380.0200.07020.52
5.5.370.0100.06720.42
5.5.360.0170.07020.39
5.5.350.0070.08320.45
5.5.340.0170.07320.84
5.5.330.0130.07320.94
5.5.320.0130.07020.86
5.5.310.0030.05020.85
5.5.300.0030.08320.80
5.5.290.0130.07720.93
5.5.280.0070.06720.93
5.5.270.0100.05020.88
5.5.260.0000.05320.91
5.5.250.0100.04720.68
5.5.240.0170.05320.19
5.5.230.0100.07720.21
5.5.220.0070.05320.29
5.5.210.0100.06320.19
5.5.200.0030.05020.11
5.5.190.0070.04020.25
5.5.180.0030.04020.15
5.5.160.0170.07020.15
5.5.150.0030.07320.23
5.5.140.0130.04020.25
5.5.130.0000.07319.99
5.5.120.0030.08320.24
5.5.110.0070.05020.25
5.5.100.0030.08020.08
5.5.90.0100.04020.16
5.5.80.0000.04320.11
5.5.70.0000.08020.16
5.5.60.0030.08020.16
5.5.50.0030.07320.09
5.5.40.0100.06720.00
5.5.30.0030.04020.08
5.5.20.0070.07319.93
5.5.10.0030.08019.98
5.5.00.0030.08720.07
5.4.450.0030.04319.28
5.4.440.0000.08319.41
5.4.430.0000.08719.16
5.4.420.0100.05019.17
5.4.410.0130.03719.33
5.4.400.0030.04719.13
5.4.390.0070.04319.09
5.4.380.0070.07319.14
5.4.370.0030.04018.95
5.4.360.0100.04018.90
5.4.350.0030.04019.04
5.4.340.0070.03718.90
5.4.320.0130.05018.88
5.4.310.0030.05019.05
5.4.300.0070.05019.03
5.4.290.0030.07718.87
5.4.280.0130.06019.02
5.4.270.0100.05019.08
5.4.260.0070.05719.14
5.4.250.0230.06018.94
5.4.240.0100.06319.02
5.4.230.0130.07018.84
5.4.220.0130.07019.13
5.4.210.0030.06719.08
5.4.200.0030.04319.09
5.4.190.0030.04319.12
5.4.180.0070.04018.89
5.4.170.0100.04319.02
5.4.160.0070.05019.19
5.4.150.0100.09019.11
5.4.140.0130.07016.43
5.4.130.0100.07716.39
5.4.120.0100.06316.36
5.4.110.0070.07316.38
5.4.100.0170.06316.48
5.4.90.0130.06316.43
5.4.80.0000.05316.36
5.4.70.0030.07316.31
5.4.60.0100.07016.25
5.4.50.0170.06316.47
5.4.40.0100.07316.39
5.4.30.0100.07016.32
5.4.20.0100.07016.47
5.4.10.0030.04316.36
5.4.00.0000.07315.73
5.3.290.0130.05014.73
5.3.280.0030.07314.53
5.3.270.0070.07314.66
5.3.260.0070.07714.54
5.3.250.0130.07314.57
5.3.240.0100.07714.75
5.3.230.0070.08014.74
5.3.220.0070.06314.58
5.3.210.0070.08014.68
5.3.200.0030.06714.68
5.3.190.0030.05714.54
5.3.180.0100.07014.50
5.3.170.0100.07314.63
5.3.160.0170.06314.52
5.3.150.0100.07014.68
5.3.140.0030.05014.62
5.3.130.0100.07714.67
5.3.120.0030.04714.56
5.3.110.0030.04714.55
5.3.100.0100.05014.07
5.3.90.0100.06313.96
5.3.80.0070.07314.11
5.3.70.0070.04714.08
5.3.60.0100.07314.14
5.3.50.0030.07313.96
5.3.40.0030.07314.05
5.3.30.0170.05313.96
5.3.20.0070.05713.61
5.3.10.0070.05013.65
5.3.00.0130.03713.67
5.2.170.0030.05011.21
5.2.160.0100.05711.21
5.2.150.0070.03311.27
5.2.140.0000.04311.08
5.2.130.0030.06311.20
5.2.120.0030.05711.21
5.2.110.0070.05711.00
5.2.100.0070.03711.02
5.2.90.0030.05310.96
5.2.80.0030.05011.24
5.2.70.0030.04010.96
5.2.60.0130.04010.95
5.2.50.0000.06311.13
5.2.40.0100.05311.14
5.2.30.0070.03311.04
5.2.20.0100.03011.03
5.2.10.0100.04310.73
5.2.00.0030.06310.64
5.1.60.0130.04310.00
5.1.50.0070.03010.07
5.1.40.0130.04010.09
5.1.30.0000.04310.33
5.1.20.0130.04710.27
5.1.10.0030.05310.19
5.1.00.0000.05310.14
5.0.50.0030.0408.43
5.0.40.0000.0308.50
5.0.30.0000.0678.34
5.0.20.0000.0308.34
5.0.10.0000.0408.34
5.0.00.0000.0538.34
4.4.90.0070.0308.34
4.4.80.0030.0378.34
4.4.70.0000.0208.34
4.4.60.0030.0338.34
4.4.50.0030.0278.34
4.4.40.0030.0408.34
4.4.30.0030.0378.34
4.4.20.0000.0408.34
4.4.10.0030.0238.34
4.4.00.0000.0578.34
4.3.110.0100.0278.34
4.3.100.0000.0378.34
4.3.90.0000.0408.34
4.3.80.0070.0338.34
4.3.70.0070.0208.34
4.3.60.0000.0338.34
4.3.50.0000.0338.34
4.3.40.0030.0508.34
4.3.30.0000.0378.34
4.3.20.0030.0378.34
4.3.10.0000.0278.34
4.3.00.0100.0278.34

preferences:
57.86 ms | 401 KiB | 5 Q