3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function nothingspecial($dings) { $dinging = function ($ding) { $ding = preg_replace("/[^- ()\.\&,_'´`áàäçéèêñóòôöüæøåìíùúâêîôûÁÀÄÇÉÈÊÑÓÒÔÖÜÆØÅÌÍÙÚÂÊÎÔÛß@€:0-9a-zA-Z&+]/", " ", $ding ); $ding = stripslashes(trim(str_replace("'","´",$ding))); $funduz = array('&auml ','&ouml ','&uuml ','&Auml ','&Ouml ','&Uuml ','&szlig '); $ersetzuz = array('ä','ö','ü','Ä','Ö','Ü','ß'); $ding = str_replace($funduz, $ersetzuz, $ding); return $ding; }; return is_array($dings) ? array_map($dinging, $dings) : $dinging($dings); } function old_nothingspecial($dings) { $dings = preg_replace("/[^- ()\.\&,_'´`áàäçéèêñóòôöüæøåìíùúâêîôûÁÀÄÇÉÈÊÑÓÒÔÖÜÆØÅÌÍÙÚÂÊÎÔÛß@€:0-9a-zA-Z&+]/"," ", $dings); $dings = stripslashes(trim(str_replace("'","´",$dings))); $funduz = array('&auml ','&ouml ','&uuml ','&Auml ','&Ouml ','&Uuml ','&szlig '); $ersetzuz = array('ä','ö','ü','Ä','Ö','Ü','ß'); $dings = str_replace($funduz,$ersetzuz,$dings); return $dings; } var_dump(old_nothingspecial(['DópÂ\n'])); var_dump(old_nothingspecial('DópÂ\n'));
based on P5KVY
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0beta1
Warning: trim() expects parameter 1 to be string, array given in /in/gZ4Hp on line 26 string(0) "" string(8) "Dóp n"
Output for hhvm-3.15.4
Warning: trim() expects parameter 1 to be string, array given in /in/gZ4Hp on line 26 Warning: stripslashes() expects parameter 1 to be string, null given in /in/gZ4Hp on line 26 string(0) "" string(8) "Dóp n"