3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php session_start(); $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.)"; if ( $_SESSION['pack'] == "FL PACKAGE - 3DAY" ) { $dest = $array[1]; $exp = explode('- ', $_SESSION['pack']); $pack_days = str_replace('DAY', '', $exp); } //JAN - 1 //FEB - 2 //MAR - 3 //APR - 4 //MAY - 5 //JUN - 6 //JUL - 7 //AUG - 8 //SEP - 9 //OCT - 10 //NOV - 11 //DEC - 12 $explode = explode('/', $_POST['date_dep']); $day = $explode[1] + $pack_days; $month = $explode[0]; $year = $explode[2]; if ( ($explode[0] == 1 OR $explode[0] == 3 OR $explode[0] == 5 OR $explode[0] == 7 OR $explode[0] == 8 OR $explode[0] == 10 OR $explode[0] == 12) && $day > 31 ) { $day -= 31; $month += 1; } if ( ($explode[0] == 4 OR $explode[0] == 6 OR $explode[0] == 9 OR $explode[0] == 11) && $day > 30 ) { $day -= 30; $month += 1; } if ( $explode[0] == 2 && $day > 28 ) { $day -= 28; $month += 1; } if ( $month == 13 ) { $month -= 12; $year += 1; } $date = $month.'/'.$day.'/'.$year; $from = "from:FLL"; //leg1 $from2 = ",to:".$dest; //leg1.2 $datefrom = ",departure:".$_POST['date_dep']."TANYT"; //leg1.3 $to = "from:".$dest; //leg2 $to2 = ",to:FLL"; //leg2.1 $dateto = ",departure:".$date."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);
based on PQq2t
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined index: pack in /in/85Ftc on line 13 Notice: Undefined index: date_dep in /in/85Ftc on line 33 Notice: Undefined offset: 1 in /in/85Ftc on line 34 Notice: Undefined variable: pack_days in /in/85Ftc on line 34 Notice: Undefined offset: 2 in /in/85Ftc on line 36 Notice: Undefined variable: dest in /in/85Ftc on line 65 Notice: Undefined index: date_dep in /in/85Ftc on line 66 Notice: Undefined variable: dest in /in/85Ftc on line 68 Notice: Undefined index: children in /in/85Ftc on line 73 Notice: Undefined index: children in /in/85Ftc on line 90 Notice: Undefined index: adults in /in/85Ftc on line 91 Warning: Cannot modify header information - headers already sent by (output started at /in/85Ftc:13) in /in/85Ftc on line 97
Output for hhvm-3.12.0
Notice: Undefined index: pack in /in/85Ftc on line 13 Notice: Undefined index: date_dep in /in/85Ftc on line 33 Warning: explode() expects parameter 2 to be string, null given in /in/85Ftc on line 33 Notice: Undefined variable: pack_days in /in/85Ftc on line 34 Notice: Undefined variable: dest in /in/85Ftc on line 65 Notice: Undefined index: date_dep in /in/85Ftc on line 66 Notice: Undefined variable: dest in /in/85Ftc on line 68 Notice: Undefined index: children in /in/85Ftc on line 73 Notice: Undefined index: children in /in/85Ftc on line 90 Notice: Undefined index: adults in /in/85Ftc on line 91
Output for hhvm-3.10.0
Notice: Undefined index: pack in /in/85Ftc on line 13 Notice: Undefined index: date_dep in /in/85Ftc on line 33 Notice: Undefined index: 1 in /in/85Ftc on line 34 Notice: Undefined variable: pack_days in /in/85Ftc on line 34 Notice: Undefined index: 2 in /in/85Ftc on line 36 Notice: Undefined variable: dest in /in/85Ftc on line 65 Notice: Undefined index: date_dep in /in/85Ftc on line 66 Notice: Undefined variable: dest in /in/85Ftc on line 68 Notice: Undefined index: children in /in/85Ftc on line 73 Notice: Undefined index: children in /in/85Ftc on line 90 Notice: Undefined index: adults in /in/85Ftc on line 91
Output for 5.2.3 - 5.2.17
Notice: Undefined index: pack in /in/85Ftc on line 13 Notice: Undefined index: date_dep in /in/85Ftc on line 33 Notice: Undefined offset: 1 in /in/85Ftc on line 34 Notice: Undefined variable: pack_days in /in/85Ftc on line 34 Notice: Undefined offset: 2 in /in/85Ftc on line 36 Notice: Undefined variable: dest in /in/85Ftc on line 65 Notice: Undefined index: date_dep in /in/85Ftc on line 66 Notice: Undefined variable: dest in /in/85Ftc on line 68 Notice: Undefined index: children in /in/85Ftc on line 73 Notice: Undefined index: children in /in/85Ftc on line 90 Notice: Undefined index: adults in /in/85Ftc on line 91 Warning: Cannot modify header information - headers already sent by (output started at /in/85Ftc:13) in /in/85Ftc on line 97
Output for 5.0.4 - 5.2.2
Warning: session_start(): Cannot send session cookie - headers already sent in /in/85Ftc on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/85Ftc:3) in /in/85Ftc on line 3 Notice: Undefined index: pack in /in/85Ftc on line 13 Notice: Undefined index: date_dep in /in/85Ftc on line 33 Notice: Undefined offset: 1 in /in/85Ftc on line 34 Notice: Undefined variable: pack_days in /in/85Ftc on line 34 Notice: Undefined offset: 2 in /in/85Ftc on line 36 Notice: Undefined variable: dest in /in/85Ftc on line 65 Notice: Undefined index: date_dep in /in/85Ftc on line 66 Notice: Undefined variable: dest in /in/85Ftc on line 68 Notice: Undefined index: children in /in/85Ftc on line 73 Notice: Undefined index: children in /in/85Ftc on line 90 Notice: Undefined index: adults in /in/85Ftc on line 91
Output for 4.3.2 - 5.0.3
Warning: session_start(): Cannot send session cookie - headers already sent in /in/85Ftc on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/85Ftc:3) in /in/85Ftc on line 3 Notice: Undefined index: pack in /in/85Ftc on line 13 Notice: Undefined index: date_dep in /in/85Ftc on line 33 Notice: Undefined offset: 1 in /in/85Ftc on line 34 Notice: Undefined variable: pack_days in /in/85Ftc on line 34 Notice: Undefined offset: 2 in /in/85Ftc on line 36 Notice: Undefined variable: dest in /in/85Ftc on line 65 Notice: Undefined index: date_dep in /in/85Ftc on line 66 Notice: Undefined variable: dest in /in/85Ftc on line 68 Notice: Undefined index: children in /in/85Ftc on line 73 Notice: Undefined index: children in /in/85Ftc on line 90 Notice: Undefined index: adults in /in/85Ftc on line 91
Output for 4.3.0 - 4.3.1
Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent in /in/85Ftc on line 3 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /in/85Ftc:3) in /in/85Ftc on line 3 Notice: Undefined index: pack in /in/85Ftc on line 13 Notice: Undefined index: date_dep in /in/85Ftc on line 33 Notice: Undefined offset: 1 in /in/85Ftc on line 34 Notice: Undefined variable: pack_days in /in/85Ftc on line 34 Notice: Undefined offset: 2 in /in/85Ftc on line 36 Notice: Undefined variable: dest in /in/85Ftc on line 65 Notice: Undefined index: date_dep in /in/85Ftc on line 66 Notice: Undefined variable: dest in /in/85Ftc on line 68 Notice: Undefined index: children in /in/85Ftc on line 73 Notice: Undefined index: children in /in/85Ftc on line 90 Notice: Undefined index: adults in /in/85Ftc on line 91