3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* * Get Full Filter Name from Abbreviation */ function getFilterName ($filterAbbreviation) { $filters = array( "R" => "Restuarant", "B" => "Bar", "S" => "Store", "L" => "Lodging", "Q" => "Recreation", "G" => "Gas Station", "E" => "Entertainment", "C" => "Club" ); return $filters[$filterAbbreviation]; } /* * Parse Filterstring */ function parseFilterString($filterString) { $returnVal = ""; $filterLetters = str_split($filterString, 1); for($x = 0; $x < strlen($filterString); $x++) { $returnVal .= "(type <=> '" . getFilterName($filterLetters[$x]) . "') OR "; } if (strlen($returnVal) > 0) $returnVal = substr($returnVal,0,-4); //remove final " OR " from filterstring else $returnVal = "type = 'VOID'"; //if everything is filtered, make sure to set type to something not available return $returnVal; } parseFilterString("RBC");
Output for 5.0.0 - 7.1.0
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/PO4sh on line 24
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/PO4sh on line 24
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/PO4sh on line 24