3v4l.org

run code in 300+ PHP versions simultaneously
<?php //===================================================================================== //Apply real_escape_string to strip out SQL injection function makeSafe($value){ //if (isset($value)){ $value = $this->clean_html($value); $value = strip_tags(trim($value)); //} return $value; //return mysql_real_escape_string($value); } //===================================================================================== //Clean out html code. From html2txt() in http://us2.php.net/manual/en/function.strip-tags.php function clean_html($document){ $search = array( '@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA ); //Replace any of the patterns listed above $text = preg_replace($search, '', $document); //Replace or remove any illegal characters $text = preg_replace('/;/', ' ', $text); //semicolons $text = preg_replace('/"/', "'", $text); //double quotations $text = preg_replace('/[\%\?\*]/', ' ', $text); //wildcards $text = preg_replace('/[\:\`\$\/\\\=\~\<\>\|\!\^]/', ' ', $text); //other uneeded symbols $text = preg_replace('/[-]{2,}/', '-', $text); //more than 1 dash in a row $text = preg_replace("/[\']{2,}/", "'", $text); //more than 1 single quotation in a row $text = preg_replace("/[\&]{2,}/", '&', $text); //more than 1 ampersand in a row $text = preg_replace("/[ ]{2,}/", ' ', $text); //more than 1 space in a row //And replace any leftover special characters $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); //Return the value return $text; } $mystring = " rcooper@c2ti.com test 456 Famed California pollster Joe Shumate was found dead in his home one month before Election Day 2010, surrounded by sheets of polling data he labored over for the flailing Senate bid of Carly Fiorina. Upon his death, Fiorina praised Shumate as 'the heart and sou f her team. She issued a news release praising him as a person who believed in inves"; $mystring2 = makeSafe($mystring); echo $mystring2;

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.00718.18
8.3.50.0110.01116.38
8.3.40.0120.00318.69
8.3.30.0040.01118.66
8.3.20.0040.00420.34
8.3.10.0030.00521.82
8.3.00.0040.00419.69
8.2.180.0150.00418.66
8.2.170.0070.00722.96
8.2.160.0070.00720.52
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00417.75
8.2.110.0000.01019.30
8.2.100.0080.00417.84
8.2.90.0000.00819.22
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0060.00317.93
8.2.50.0110.00018.10
8.2.40.0070.00019.21
8.2.30.0050.00220.50
8.2.20.0060.00317.67
8.2.10.0000.00818.12
8.2.00.0040.00418.05
8.1.280.0070.01025.92
8.1.270.0040.01421.98
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.10
8.1.230.0040.00717.64
8.1.220.0030.00617.74
8.1.210.0060.00318.77
8.1.200.0000.00917.36
8.1.190.0040.00417.36
8.1.180.0030.00518.10
8.1.170.0090.00018.46
8.1.160.0000.00821.98
8.1.150.0040.00418.82
8.1.140.0040.00417.43
8.1.130.0040.00417.54
8.1.120.0070.00017.31
8.1.110.0040.00417.40
8.1.100.0040.00417.28
8.1.90.0000.00817.29
8.1.80.0030.00517.34
8.1.70.0030.00317.43
8.1.60.0080.00017.59
8.1.50.0030.00617.41
8.1.40.0040.00417.48
8.1.30.0050.00317.50
8.1.20.0040.00417.63
8.1.10.0070.00417.47
8.1.00.0040.00417.56
8.0.300.0080.00018.77
8.0.290.0030.00616.75
8.0.280.0030.00318.39
8.0.270.0030.00317.23
8.0.260.0000.00717.11
8.0.250.0000.00716.85
8.0.240.0030.00316.95
8.0.230.0040.00416.95
8.0.220.0000.00716.79
8.0.210.0050.00216.89
8.0.200.0000.01016.91
8.0.190.0040.00416.92
8.0.180.0040.00416.81
8.0.170.0000.00916.87
8.0.160.0000.00716.92
8.0.150.0000.00716.82
8.0.140.0030.00316.83
8.0.130.0030.00313.40
8.0.120.0040.00416.88
8.0.110.0040.00416.91
8.0.100.0040.00416.93
8.0.90.0040.00416.93
8.0.80.0040.01516.90
8.0.70.0000.00716.87
8.0.60.0070.00016.94
8.0.50.0070.00016.89
8.0.30.0150.00517.13
8.0.20.0060.01217.40
8.0.10.0030.00517.08
8.0.00.0120.00916.88
7.4.330.0050.00015.08
7.4.320.0050.00216.43
7.4.300.0060.00016.60
7.4.290.0050.00316.38
7.4.280.0030.00516.39
7.4.270.0030.00316.56
7.4.260.0080.00016.51
7.4.250.0030.00516.47
7.4.240.0030.00316.53
7.4.230.0000.00716.62
7.4.220.0070.01116.51
7.4.210.0100.00316.70
7.4.200.0020.00516.49
7.4.160.0110.00616.59
7.4.150.0140.00317.40
7.4.140.0150.00317.86
7.4.130.0130.00816.59
7.4.120.0090.01116.53
7.4.110.0090.00916.47
7.4.100.0110.00716.61
7.4.90.0100.00616.48
7.4.80.0090.00919.39
7.4.70.0180.00316.58
7.4.60.0160.00016.47
7.4.50.0080.00016.38
7.4.40.0170.00016.65
7.4.30.0110.00716.48
7.4.10.0070.01516.45
7.4.00.0060.01015.72
7.3.330.0040.00413.31
7.3.320.0030.00313.22
7.3.310.0070.00016.40
7.3.300.0060.00016.12
7.3.290.0080.00816.29
7.3.280.0090.01116.31
7.3.270.0100.01617.40
7.3.260.0060.01116.25
7.3.250.0050.01116.38
7.3.240.0160.00016.30
7.3.230.0060.01316.62
7.3.210.0100.00716.28
7.3.200.0100.00716.39
7.3.190.0100.00616.34
7.3.180.0100.00616.49
7.3.170.0000.01516.66
7.3.160.0090.00616.43
7.3.130.0120.00616.25
7.3.120.0030.01616.32
7.3.110.0000.01716.24
7.3.100.0100.00316.43
7.3.90.0000.01216.18
7.3.80.0070.00716.24
7.3.70.0060.01216.28
7.3.60.0000.01516.28
7.3.50.0000.01316.34
7.3.40.0070.00716.39
7.3.30.0060.00916.46
7.3.20.0070.00718.19
7.3.10.0050.00617.25
7.3.00.0030.01217.43
7.2.330.0040.01416.32
7.2.320.0370.02216.58
7.2.310.0070.01016.28
7.2.300.0060.00916.59
7.2.290.0090.01516.22
7.2.260.0100.01016.41
7.2.250.0070.01316.41
7.2.240.0100.00716.63
7.2.230.0080.00816.29
7.2.220.0100.01016.50
7.2.210.0060.00316.40
7.2.200.0060.00616.40
7.2.190.0090.00616.57
7.2.180.0040.01116.37
7.2.170.0130.00016.47
7.2.160.0030.01016.38
7.2.150.0070.01018.28
7.2.140.0040.01118.43
7.2.130.0050.01117.56
7.2.120.0090.00717.56
7.2.110.0070.00917.48
7.2.100.0040.00717.49
7.2.90.0090.00617.52
7.2.80.0060.00517.51
7.2.70.0050.01017.56
7.2.60.0100.00917.14
7.2.50.0110.00517.34
7.2.40.0060.00817.49
7.2.30.0060.00817.45
7.2.20.0040.00717.53
7.2.10.0050.01017.54
7.2.00.0080.00718.08
7.1.330.0060.01117.32
7.1.320.0100.01017.37
7.1.310.0070.00717.25
7.1.300.0030.01017.30
7.1.290.0040.01117.36
7.1.280.0000.01217.20
7.1.270.0000.01217.22
7.1.260.0030.00917.11
7.1.250.0020.01016.54
7.1.240.0000.01517.14
7.1.230.0100.00317.03
7.1.220.0100.00617.24
7.1.210.0030.00617.25
7.1.200.0060.00716.49
7.1.190.0040.00717.18
7.1.180.0030.00917.24
7.1.170.0030.00617.09
7.1.160.0040.01117.13
7.1.150.0080.00417.07
7.1.140.0070.00717.18
7.1.130.0030.00917.23
7.1.120.0000.01917.14
7.1.110.0130.00317.11
7.1.100.0040.01017.61
7.1.90.0060.00717.25
7.1.80.0070.00717.34
7.1.70.0060.00517.19
7.1.60.0060.00718.16
7.1.50.0160.01125.96
7.1.40.0110.00317.17
7.1.30.0030.01017.22
7.1.20.0030.01017.18
7.1.10.0050.00517.36
7.1.00.0080.03819.73
7.0.330.0040.01116.98
7.0.320.0030.00717.04
7.0.310.0070.00416.85
7.0.300.0060.00316.96
7.0.290.0030.00616.95
7.0.280.0040.00816.87
7.0.270.0090.00316.96
7.0.260.0060.00616.75
7.0.250.0070.01016.96
7.0.240.0040.01116.96
7.0.230.0080.00417.04
7.0.220.0060.00617.05
7.0.210.0060.00917.09
7.0.200.0050.00516.75
7.0.190.0030.00717.17
7.0.180.0030.01016.79
7.0.170.0040.01117.07
7.0.160.0070.00717.04
7.0.150.0060.00816.97
7.0.140.0130.00317.07
7.0.130.0040.00817.01
7.0.120.0040.00816.89
7.0.110.0040.00416.79
7.0.100.0040.01217.00
7.0.90.0080.00816.86
7.0.80.0100.00016.86
7.0.70.0040.01116.85
7.0.60.0000.03618.37
7.0.50.0050.03117.44
7.0.40.0080.04417.47
7.0.30.0190.04217.52
7.0.20.0100.03017.52
7.0.10.0050.02617.60
7.0.00.0030.03317.53
5.6.400.0000.01515.90
5.6.390.0040.01415.89
5.6.380.0070.00715.44
5.6.370.0050.00515.72
5.6.360.0120.00315.76
5.6.350.0100.00316.08
5.6.340.0100.00315.50
5.6.330.0070.00715.84
5.6.320.0070.01115.63
5.6.310.0090.00415.87
5.6.300.0060.00915.64
5.6.290.0030.00715.80
5.6.280.0070.01818.51
5.6.270.0080.00815.70
5.6.260.0000.01415.96
5.6.250.0060.00315.69
5.6.240.0070.00315.74
5.6.230.0030.01016.00
5.6.220.0030.00615.97
5.6.210.0030.03218.32
5.6.200.0060.04317.11
5.6.190.0070.02218.23
5.6.180.0130.02518.15
5.6.170.0270.03318.07
5.6.160.0050.03018.36
5.6.150.0030.03516.99
5.6.140.0080.03916.93
5.6.130.0120.03816.98
5.6.120.0070.03018.52
5.6.110.0100.04018.50
5.6.100.0080.04318.42
5.6.90.0090.02518.35
5.6.80.0020.02718.07
5.6.70.0030.00615.57
5.6.60.0000.01515.67
5.6.50.0110.00715.48
5.6.40.0100.00716.01
5.6.30.0040.01615.73
5.6.20.0130.00415.73
5.6.10.0030.01915.46
5.6.00.0090.00615.64
5.5.380.0040.01215.64
5.5.370.0070.00715.59
5.5.360.0040.00715.60
5.5.350.0080.04118.01
5.5.340.0050.02716.82
5.5.330.0050.02917.99
5.5.320.0150.03017.87
5.5.310.0150.02418.02
5.5.300.0060.02016.88
5.5.290.0070.02016.87
5.5.280.0130.03718.31
5.5.270.0050.03418.25
5.5.260.0060.04818.28
5.5.250.0070.02718.09
5.5.240.0180.03918.06
5.5.230.0040.01115.70
5.5.220.0060.01315.61
5.5.210.0080.00615.60
5.5.200.0030.01315.59
5.5.190.0000.01515.62
5.5.180.0070.01015.61
5.5.170.0060.00915.84
5.5.160.0090.00615.62
5.5.150.0100.00715.54
5.5.140.0100.00315.44
5.5.130.0100.00715.75
5.5.120.0060.00615.69
5.5.110.0000.01215.61
5.5.100.0070.00715.58
5.5.90.0030.01315.55
5.5.80.0020.00915.87
5.5.70.0040.00815.41
5.5.60.0060.01015.49
5.5.50.0040.01115.69
5.5.40.0070.00715.76
5.5.30.0060.00915.67
5.5.20.0030.01015.62
5.5.10.0060.00615.52
5.5.00.0100.00315.55
5.4.450.0270.03316.10
5.4.440.0440.02715.97
5.4.430.0370.03115.98
5.4.420.0370.04115.99
5.4.410.0370.03616.01
5.4.400.0470.03015.83
5.4.390.0420.02715.94
5.4.380.0420.03715.76
5.4.370.0380.03215.79
5.4.360.0550.03215.93
5.4.350.0330.03415.86
5.4.340.0430.04115.90
5.4.330.0000.00912.40
5.4.320.0520.03015.67
5.4.310.0380.03015.84
5.4.300.0340.03215.78
5.4.290.0340.03215.64
5.4.280.0330.04015.72
5.4.270.0330.03315.73
5.4.260.0350.03315.91
5.4.250.0390.02715.83
5.4.240.0260.03115.99
5.4.230.0270.03615.76
5.4.220.0300.03115.83
5.4.210.0320.03615.65
5.4.200.0330.03415.82
5.4.190.0400.02415.85
5.4.180.0320.02815.98
5.4.170.0370.03315.86
5.4.160.0280.03015.80
5.4.150.0400.03515.80
5.4.140.0300.03814.60
5.4.130.0350.03014.40
5.4.120.0360.03114.62
5.4.110.0430.02614.58
5.4.100.0350.02814.57
5.4.90.0350.03514.55
5.4.80.0300.03314.52
5.4.70.0020.04214.50
5.4.60.0070.02314.41
5.4.50.0050.02014.44
5.4.40.0140.01814.46
5.4.30.0210.03314.58
5.4.20.0080.02514.59
5.4.10.0040.00412.53
5.4.00.0000.01212.59

preferences:
47.88 ms | 400 KiB | 5 Q