3v4l.org

run code in 300+ PHP versions simultaneously
<?php function slashit(&$aray, $db_link) { foreach ($aray as $key => &$value) if(is_array($value)) slashit($value, $link); else $aray[$key] = mysql_real_escape_string($value, $db_link); } // Test: $fruits = array ( "fruits" => array("a" => "or'ange", "b" => "ban'ana", "c" => "apple'"), "numbers" => array(1, 2, 3, 4, 5, 6), "holes" => array("fir'st", 5 => "sec'ond", "thir'd"), "odma" => "jugo'slavija" ); // You have to make link to the database or can use addslashes instead of mysql_real_escape_string and remove $link from function definition slashit($fruits, $dbLink); echo "<pre>"; print_r($fruits); echo "</pre>";

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.0160.00318.68
8.3.50.0080.00822.05
8.3.40.0120.00618.75
8.3.30.0030.01018.71
8.3.20.0080.00018.73
8.3.10.0040.00421.22
8.3.00.0000.00821.96
8.2.180.0060.01216.75
8.2.170.0100.01022.96
8.2.160.0110.00320.45
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00421.18
8.2.110.0090.00020.52
8.2.100.0070.00417.72
8.2.90.0040.00419.13
8.2.80.0040.00419.42
8.2.70.0000.00817.61
8.2.60.0030.00517.80
8.2.50.0090.00018.07
8.2.40.0070.00018.03
8.2.30.0040.00421.25
8.2.20.0050.00217.64
8.2.10.0040.00417.87
8.2.00.0070.00317.92
8.1.280.0040.01125.92
8.1.270.0000.00823.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00822.52
8.1.230.0040.00720.85
8.1.220.0040.00418.77
8.1.210.0000.00818.90
8.1.200.0030.00617.47
8.1.190.0040.00417.41
8.1.180.0040.00418.10
8.1.170.0000.00818.60
8.1.160.0040.00418.95
8.1.150.0040.00418.53
8.1.140.0040.00417.46
8.1.130.0050.00317.82
8.1.120.0050.00517.50
8.1.110.0000.00717.35
8.1.100.0000.00717.45
8.1.90.0050.00217.39
8.1.80.0000.00717.46
8.1.70.0030.00317.42
8.1.60.0060.00317.62
8.1.50.0070.00017.55
8.1.40.0030.00617.58
8.1.30.0050.00317.66
8.1.20.0030.00517.68
8.1.10.0060.00317.50
8.1.00.0050.00517.56
8.0.300.0080.00019.90
8.0.290.0040.00417.16
8.0.280.0000.00818.35
8.0.270.0030.00317.33
8.0.260.0000.00616.89
8.0.250.0040.00417.11
8.0.240.0000.00816.94
8.0.230.0040.00417.02
8.0.220.0040.00416.95
8.0.210.0030.00316.85
8.0.200.0030.00316.93
8.0.190.0000.00716.98
8.0.180.0040.00416.93
8.0.170.0000.00816.92
8.0.160.0000.00816.90
8.0.150.0050.00216.95
8.0.140.0100.00016.86
8.0.130.0000.00513.41
8.0.120.0000.00716.94
8.0.110.0050.00217.00
8.0.100.0040.00416.83
8.0.90.0080.00017.08
8.0.80.0000.01516.87
8.0.70.0070.00016.79
8.0.60.0070.00016.96
8.0.50.0040.00416.95
8.0.30.0090.00917.18
8.0.20.0100.01017.40
8.0.10.0080.00017.02
8.0.00.0050.01316.81
7.4.330.0050.00016.89
7.4.320.0030.00316.62
7.4.300.0000.00616.50
7.4.290.0050.00216.65
7.4.280.0000.00716.50
7.4.270.0000.00616.47
7.4.260.0060.00013.34
7.4.250.0050.00316.39
7.4.240.0030.00316.61
7.4.230.0030.00316.71
7.4.220.0060.01016.41
7.4.210.0080.00916.56
7.4.200.0070.00016.63
7.4.190.0000.00716.63
7.4.160.0080.00816.30
7.4.150.0120.00617.40
7.4.140.0120.00517.86
7.4.130.0160.01216.71
7.4.120.0080.00916.64
7.4.110.0030.01316.61
7.4.100.0100.01316.59
7.4.90.0120.00816.44
7.4.80.0070.01319.39
7.4.70.0100.00716.43
7.4.60.0070.01016.50
7.4.50.0030.00616.49
7.4.40.0070.01022.77
7.4.30.0110.00416.43
7.4.00.0030.01015.04
7.3.330.0000.00513.44
7.3.320.0060.00013.44
7.3.310.0080.00016.33
7.3.300.0030.00316.32
7.3.290.0000.02016.46
7.3.280.0060.00916.35
7.3.270.0150.00317.40
7.3.260.0110.00718.24
7.3.250.0050.01216.60
7.3.240.0120.00416.72
7.3.230.0160.00316.39
7.3.210.0130.00316.57
7.3.200.0080.00819.39
7.3.190.0170.00716.64
7.3.180.0080.00816.55
7.3.170.0070.01116.44
7.3.160.0000.01616.58
7.3.120.0030.01014.81
7.2.330.0130.01016.68
7.2.320.0090.00916.47
7.2.310.0030.01316.78
7.2.300.0060.01016.60
7.2.290.0090.01216.56
7.2.60.0030.01016.80
7.2.00.0030.00919.38
7.1.200.0070.00315.72
7.1.100.0130.00017.88
7.1.70.0160.01617.04
7.1.60.0170.00719.17
7.1.50.0070.01416.72
7.1.00.0030.06022.48
7.0.200.0040.00416.85
7.0.140.0030.07321.92
7.0.100.0500.05319.98
7.0.90.0370.08020.00
7.0.80.0530.07719.92
7.0.70.0030.04319.94
7.0.60.0270.04719.95
7.0.50.0530.08720.34
7.0.40.0030.08319.92
7.0.30.0130.04320.13
7.0.20.0100.05319.93
7.0.10.0170.07020.09
7.0.00.0000.08720.09
5.6.280.0070.07020.78
5.6.250.0070.07020.63
5.6.240.0070.08020.64
5.6.230.0030.05020.60
5.6.220.0130.04020.50
5.6.210.0030.06320.69
5.6.200.0100.04721.03
5.6.190.0130.08320.93
5.6.180.0170.04721.07
5.6.170.0130.08021.09
5.6.160.0030.09021.08
5.6.150.0030.09021.11
5.6.140.0070.05021.03
5.6.130.0100.08321.06
5.6.120.0170.07320.94
5.6.110.0030.08021.08
5.6.100.0130.06721.04
5.6.90.0030.07020.98
5.6.80.0100.03320.44
5.6.70.0000.04320.52
5.6.60.0070.03720.40
5.6.50.0000.04320.44
5.6.40.0070.03720.47
5.6.30.0070.04020.37
5.6.20.0070.04020.38
5.6.10.0130.07720.48
5.6.00.0030.07320.43
5.5.380.0200.06320.46
5.5.370.0030.06320.37
5.5.360.0070.06720.39
5.5.350.0100.07320.39
5.5.340.0070.07020.81
5.5.330.0130.07720.74
5.5.320.0100.07720.88
5.5.310.0200.07020.81
5.5.300.0070.07320.93
5.5.290.0030.06720.85
5.5.280.0100.07720.77
5.5.270.0030.05720.73
5.5.260.0130.07020.86
5.5.250.0030.05320.71
5.5.240.0130.06320.30
5.5.230.0130.06020.29
5.5.220.0130.03020.24
5.5.210.0000.04320.27
5.5.200.0000.04320.29
5.5.190.0000.04720.16
5.5.180.0130.03020.25
5.5.160.0070.03320.22
5.5.150.0030.06720.23
5.5.140.0170.06020.27
5.5.130.0030.06720.27
5.5.120.0030.03720.16
5.5.110.0070.04720.16
5.5.100.0100.05320.17
5.5.90.0030.04020.14
5.5.80.0030.03720.21
5.5.70.0030.04019.98
5.5.60.0070.04720.07
5.5.50.0030.04020.01
5.5.40.0030.04020.13
5.5.30.0070.04720.16
5.5.20.0000.06019.97
5.5.10.0070.05020.05
5.5.00.0170.02320.04
5.4.450.0070.07719.38
5.4.440.0030.08319.50
5.4.430.0000.06019.55
5.4.420.0000.05719.22
5.4.410.0100.03319.32
5.4.400.0000.03719.13
5.4.390.0070.04719.19
5.4.380.0030.03319.13
5.4.370.0070.03018.86
5.4.360.0000.04319.21
5.4.350.0030.04019.17
5.4.340.0100.03018.96
5.4.320.0030.04018.86
5.4.310.0170.06318.90
5.4.300.0100.07718.90
5.4.290.0070.06319.13
5.4.280.0030.03719.05
5.4.270.0030.04718.90
5.4.260.0070.06018.86
5.4.250.0000.04019.09
5.4.240.0000.04319.13
5.4.230.0070.03719.03
5.4.220.0130.02719.12
5.4.210.0030.03719.20
5.4.200.0030.04719.05
5.4.190.0030.04719.04
5.4.180.0100.04019.15
5.4.170.0000.04018.86
5.4.160.0030.03719.12
5.4.150.0100.03319.20
5.4.140.0030.03316.41
5.4.130.0030.03716.45
5.4.120.0070.05016.43
5.4.110.0000.04716.34
5.4.100.0070.03316.50
5.4.90.0070.03316.54
5.4.80.0070.03016.38
5.4.70.0030.03716.48
5.4.60.0100.02716.34
5.4.50.0030.03716.32
5.4.40.0070.03316.39
5.4.30.0170.03316.44
5.4.20.0070.07016.37
5.4.10.0070.06316.46
5.4.00.0000.08015.78
5.3.290.0070.07314.65
5.3.280.0070.03314.72
5.3.270.0100.03314.56
5.3.260.0030.04014.66
5.3.250.0030.03714.73
5.3.240.0070.03314.69
5.3.230.0000.04014.54
5.3.220.0030.03714.60
5.3.210.0100.03314.55
5.3.200.0070.03714.59
5.3.190.0030.04314.60
5.3.180.0130.05014.69
5.3.170.0070.03314.69
5.3.160.0030.04314.56
5.3.150.0000.04014.57
5.3.140.0070.03014.68
5.3.130.0030.07714.54
5.3.120.0070.07314.69
5.3.110.0130.07014.66
5.3.100.0130.03714.15
5.3.90.0070.03714.15
5.3.80.0100.06714.15
5.3.70.0100.06714.15
5.3.60.0030.04714.15
5.3.50.0030.07714.15
5.3.40.0070.07714.15
5.3.30.0030.07714.15
5.3.20.0070.04714.15
5.3.10.0070.07314.15
5.3.00.0130.06314.15
5.2.170.0100.05714.15
5.2.160.0070.06014.15
5.2.150.0000.07014.15
5.2.140.0070.05714.15
5.2.130.0070.05014.15
5.2.120.0130.05314.15
5.2.110.0070.06014.15
5.2.100.0030.04714.15
5.2.90.0100.05314.15
5.2.80.0130.05314.15
5.2.70.0070.05714.15
5.2.60.0030.05314.15
5.2.50.0000.05714.15
5.2.40.0030.06014.15
5.2.30.0130.05314.15
5.2.20.0070.06314.15
5.2.10.0030.06314.15
5.2.00.0030.04314.15
5.1.60.0070.04314.15
5.1.50.0030.05314.15
5.1.40.0070.04714.15
5.1.30.0070.05314.15
5.1.20.0070.05714.15
5.1.10.0030.05314.15
5.1.00.0000.05714.15
5.0.50.0070.04014.15
5.0.40.0030.03714.15
5.0.30.0000.06714.15
5.0.20.0070.04014.15
5.0.10.0070.03714.15
5.0.00.0070.05714.15
4.4.90.0030.03714.15
4.4.80.0070.02714.15
4.4.70.0030.02014.15
4.4.60.0030.03714.15
4.4.50.0000.04014.15
4.4.40.0000.05314.15
4.4.30.0000.04014.15
4.4.20.0000.03714.15
4.4.10.0000.03714.15
4.4.00.0000.05314.15
4.3.110.0000.03714.15
4.3.100.0070.02314.15
4.3.90.0000.03714.15
4.3.80.0000.05714.15
4.3.70.0030.02714.15
4.3.60.0070.01714.15
4.3.50.0100.02014.15
4.3.40.0000.05314.15
4.3.30.0000.03014.15
4.3.20.0000.03714.15
4.3.10.0030.02314.15
4.3.00.0000.03314.15

preferences:
51.14 ms | 401 KiB | 5 Q