3v4l.org

run code in 300+ PHP versions simultaneously
<?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'));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given in /in/gZ4Hp:26 Stack trace: #0 /in/gZ4Hp(26): trim(Array) #1 /in/gZ4Hp(33): old_nothingspecial(Array) #2 {main} thrown in /in/gZ4Hp on line 26
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
84.36 ms | 401 KiB | 8 Q