3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if ( isset($_POST['submit'] ) { $array[0] = ',to:Los%20Angeles,%20CA,%20United%20States%20(LAX-Los%20Angeles%20Intl.)'; $array[1] = ",to:Miami,%20FL,%20United%20States%20(MIA-Miami%20Intl.)"; $array[2] = ",to:Nassau,%20Bahamas%20(NAS-Nassau%20Intl.)"; $lower_trim = trim(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]; } $from = "from:FLL"; //leg1 $from2 = $dest; //leg1.2 $datefrom = ",departure:10/23/2014TANYT"; //leg1.3 $to = "from:Miami,%20FL,%20United%20States%20(MIA-Miami%20Intl.)"; //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="button" name="submit"> </form> <?php } ?>
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.34
Parse error: syntax error, unexpected '{' in /in/kTkaG on line 4
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 '{' in /in/kTkaG on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/kTkaG on line 4
Process exited with code 255.