3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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.)"; $ports[0] = "Fort%20Lauderdale,%20FL,%20United%20States%20(FLL-All%20Airports)"; $ports[1] = "Miami,%20FL,%20United%20States%20(MIA-Miami%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" || $lower_trim == "CALIFORNIA") { $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" || $lower_trim == "NAS" ) { $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" || $lower_trim == "CI" ) { $dest = $array[5]; } $lower_trim = str_replace(" ", "", strtoupper($_POST['airport'])); if ( $lower_trim == "FLL" || $lower_trim == "FORTLAUDERDALE" || $lower_trim == "BROWARD" || $lower_trim == "BROWARDCOUNTY" || $lower_trim == "CORALSPRINGS" || $lower_trim == "FLORIDA" || $lower_trim == "FL" ) { $airport = $ports[0]; } if ( $lower_trim == "MIAMI" || $lower_trim == "MIA" ) { $airport = $ports[1]; } $from = "from:".$airport; //leg1 $from2 = ",to:".$dest; //leg1.2 $datefrom = ",departure:".$_POST['date_dep']."TANYT"; //leg1.3 $to = "from:".$dest; //leg2 $to2 = ",to:".$airport; //leg2.1 $dateto = ",departure:".$_POST['date_ret']."TANYT"; //leg 2.3 $children_ages = array(); $num = $_POST['children']; if ( $num == 0 ) { $children_imp = null; } else { for ($i = 0; $i <= $num - 2; $i++) { $children_ages[] = '15;'; } $children_ages[$i] = '15'; $children_imp = '['.implode($children_ages).']'; } $children = "children:".$_POST['children'].$children_imp; $adults = ",adults:".$_POST['adults']; $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"; header('Location: '.$url_formatted);<?php
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected '$lower_trim' (T_VARIABLE) in /in/DDaeA on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE in /in/DDaeA on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE in /in/DDaeA on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/DDaeA on line 13
Process exited with code 255.

preferences:
207.03 ms | 1394 KiB | 124 Q