3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if ( isset($_POST['submit']) ) { $array[0] = 'Los%20Angeles,%20CA,%20United%20States%20(LAX-Los%20Angeles%20Intl.)'; $array[1] = "Miami,%20FL,%20United%20States%20(MIA-Miami%20Intl.)"; $array[2] = "Nassau,%20Bahamas%20(NAS-Nassau%20Intl.)"; $array[3] = "Honolulu,%20HI,%20United%20States%20(HNL-Honolulu%20Intl.)"; $array[4] = "Mexico%20City,%20Distrito%20Federal,%20Mexico%20(MEX-Mexico%20City%20Intl.)" $array[5] = "George%20Town,%20Cayman%20Islands%20(GCM-Owen%20Roberts%20Intl.)" $lower_trim = str_replace(" ", "", strtoupper($_POST['dest'])); if ( $lower_trim == "MIAMI" || $lower_trim == "MIAMI,FL" || $lower_trim == "MIAMI,FLORIDA" || $lower_trim == "FL" ) { $dest = $array[1]; } if ( $lower_trim == "LOSANGELES" || $lower_trim == "LA" || $lower_trim == "LOSANGELES,CALIFORNIA" || $lower_trim == "ANAHEIM" || $lower_trim == "ANAHEIM,CALIFORNIA" || $lower_trim == "ANAHEIM,CA" || $lower_trim == "LOSANGELES,CA" || $lower_trim == "LA,CA" || $lower_trim == "CA" ) { $dest = $array[0]; } if ( $lower_trim == "NASSAU" || $lower_trim == "NEW PROVIDENCE" || $lower_trim == "NASSAU,BAHAMAS" || $lower_trim == "NASSSAU,THEBAHAMAS" || $lower_trim == "THEBAHAMAS" || $lower_trim == "NASSAU,NEWPROVIDENCE" || $lower_trim == "NASSAU,NEWPROVIDENCE,THEBAHAMAS" ) { $dest = $array[2]; } if ( $lower_trim == "HONOLULU" || $lower_trim == "HONOLULU,HAWAII" || $lower_trim == "HAWAII" || $lower_trim == "HI" || $lower_trim == "HONOLULU,HI" ) { $dest = $array[3]; } if ( $lower_trim == "MEXICOCITY" || $lower_trim == "MEXICOCITY,FEDERALDISTRICT,MEXICO" || $lower_trim == "MEXICOCITY,MEXICO" || $lower_trim == "MEXICO" || $lower_trim == "FEDERALDISTRICT" ) { $dest = $array[4]; } if ( $lower_trim == "GEORGETOWN" || $lower_trim == "GEORGETOWN,CAYMANISLANDS" || $lower_trim == "CAYMANISLANDS" ) { $dest = $array[5]; } $from = "from:FLL"; //leg1 $from2 = ",to:".$dest; //leg1.2 $datefrom = ",departure:10/23/2014TANYT"; //leg1.3 $to = "from:".$dest; //leg2 $to2 = ",to:FLL"; //leg2.1 $dateto = ",departure:11/07/2014TANYT"; //leg 2.3 $children = "children:0"; $adults = ",adults:1"; $seniors = ",seniors:0"; $infant_in = ",infantinlap:Y"; $url_formatted = "http://www.travelocity.com/Flights-Search?trip=roundtrip&leg1=".$from.$from2.$datefrom."&leg2=".$to.$to2.$dateto."&passengers=".$children.$adults.$seniors.$infant_in."&mode=search"; var_dump($url_formatted); } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <h1>ENTER</h1> <input type="text" name="dest"> <input type="submit" name="submit"> </form> <?php } ?>
based on RnTkW
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected '$array' (T_VARIABLE) in /in/Cba41 on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE in /in/Cba41 on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE in /in/Cba41 on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Cba41 on line 10
Process exited with code 255.