3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
$variables["timeline"] = '{"intro":"In four decades of business MIKI Travel has grown tobecome one of the most influential private travel companies in the world.\r\nWith over 36 offices globally we offer a complete travel product.","image":"http:\/\/dev.miki.com\/sites\/MikiTravelGlobal\/files\/japan_bg.jpg","headline":"Founded in 1967","statement":"Miki Travel was founded with offices in London and Tokyo, originally to operate the incoming Japanese liesure market into Europe","timeline_entries":{"1":{"timeline_event_time":"1967","timeline_event_title":"Miki Travel was founded with offices in London and Tokyo, originally to operate the incoming Japanese liesure market into Europe","timeline_event_type":"location-event"},"2":{"timeline_event_time":"1980","timeline_event_title":"Went on to sell Europe to rest of the world","timeline_event_type":"business-event"},"3":{"timeline_event_time":"1988","timeline_event_title":"Opening of 9 Further offices in Europe (24 in total).","timeline_event_type":"location-event"},"4":{"timeline_event_time":"1990","timeline_event_title":"Extended our portfolio of products to destinations in Middle East and Africa, + Online systems developed","timeline_event_type":"business-event"},"5":{"timeline_event_time":"1994","timeline_event_title":"vLaunch of REX - Online Hotel Reservation System","timeline_event_type":"service-event"}}}'; <div class="row"> <div class="container"> <ul class="timeline"> <li class="intro"> <span class="milestone-legend hidden"></span> <span class="milestone-year"> <ul class="intro-legend"> <li class="intro-image" style="background: url('<?php print $variables["timeline"]["image"]; ?>'); background-size: cover;"> </li> <li class="intro-text"> <p class="intro-heading"> <?php if((isset($variables["timeline"])) && (sizeof($variables["timeline"]["headline"]) != 0)){ print $variables["timeline"]["headline"]; } ?> </p> <p class="intro-statement"> <?php if((isset($variables["timeline"])) && (sizeof($variables["timeline"]["statement"]) != 0)){ print $variables["timeline"]["statement"]; } ?> </p> </li> </ul> </span> <span class="milestone-legend hidden"></span> </li> <?php if((isset($variables["timeline"])) && (sizeof($variables["timeline"]["timeline_entries"]) != 0)){ $timeline_entries = $variables["timeline"]["timeline_entries"]; $counter = 0; $side = ""; $milestone = ""; foreach($timeline_entries as $entries){ $milestone .= '<li>'; if($counter % 2 == 0) { $milestone .= '<span class="milestone-legend milestone-legend-left '; $milestone .= $entries["timeline_event_type"]; $milestone .= '">'; $milestone .= '<span class="event-title">'; $milestone .= $entries["timeline_event_title"]; $milestone .= '</span>'; $milestone .= '<span class="event-image"></span>'; $milestone .= '</span>'; $milestone .= '<span class="milestone-year">'; $milestone .= "'".substr($entries["timeline_event_time"], -2); $milestone .= '</span>'; $milestone .= '<span class="milestone-legend milestone-legend-right" style="visibility: hidden;">'; $milestone .= '</span>'; }else{ $milestone .= '<span class="milestone-legend milestone-legend-left" style="visibility: hidden;">'; $milestone .= '</span>'; $milestone .= '<span class="milestone-year">'; $milestone .= "'".substr($entries["timeline_event_time"], -2); $milestone .= '</span>'; $milestone .= '<span class="milestone-legend milestone-legend-right '; $milestone .= $entries["timeline_event_type"]; $milestone .= '">'; $milestone .= '<span class="event-title">'; $milestone .= $entries["timeline_event_title"]; $milestone .= '</span>'; $milestone .= '<span class="event-image"></span>'; $milestone .= '</span>'; } $milestone .= '</li>'; $counter++; print $milestone; } } ?> </ul> </div> </div>
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
$variables["timeline"] = '{"intro":"In four decades of business MIKI Travel has grown tobecome one of the most influential private travel companies in the world.\r\nWith over 36 offices globally we offer a complete travel product.","image":"http:\/\/dev.miki.com\/sites\/MikiTravelGlobal\/files\/japan_bg.jpg","headline":"Founded in 1967","statement":"Miki Travel was founded with offices in London and Tokyo, originally to operate the incoming Japanese liesure market into Europe","timeline_entries":{"1":{"timeline_event_time":"1967","timeline_event_title":"Miki Travel was founded with offices in London and Tokyo, originally to operate the incoming Japanese liesure market into Europe","timeline_event_type":"location-event"},"2":{"timeline_event_time":"1980","timeline_event_title":"Went on to sell Europe to rest of the world","timeline_event_type":"business-event"},"3":{"timeline_event_time":"1988","timeline_event_title":"Opening of 9 Further offices in Europe (24 in total).","timeline_event_type":"location-event"},"4":{"timeline_event_time":"1990","timeline_event_title":"Extended our portfolio of products to destinations in Middle East and Africa, + Online systems developed","timeline_event_type":"business-event"},"5":{"timeline_event_time":"1994","timeline_event_title":"vLaunch of REX - Online Hotel Reservation System","timeline_event_type":"service-event"}}}'; <div class="row"> <div class="container"> <ul class="timeline"> <li class="intro"> <span class="milestone-legend hidden"></span> <span class="milestone-year"> <ul class="intro-legend"> <li class="intro-image" style="background: url(' Notice: Undefined variable: variables in /in/riC03 on line 10 '); background-size: cover;"> </li> <li class="intro-text"> <p class="intro-heading"> </p> <p class="intro-statement"> </p> </li> </ul> </span> <span class="milestone-legend hidden"></span> </li> </ul> </div> </div>
Output for 4.3.0 - 5.0.3
$variables["timeline"] = '{"intro":"In four decades of business MIKI Travel has grown tobecome one of the most influential private travel companies in the world.\r\nWith over 36 offices globally we offer a complete travel product.","image":"http:\/\/dev.miki.com\/sites\/MikiTravelGlobal\/files\/japan_bg.jpg","headline":"Founded in 1967","statement":"Miki Travel was founded with offices in London and Tokyo, originally to operate the incoming Japanese liesure market into Europe","timeline_entries":{"1":{"timeline_event_time":"1967","timeline_event_title":"Miki Travel was founded with offices in London and Tokyo, originally to operate the incoming Japanese liesure market into Europe","timeline_event_type":"location-event"},"2":{"timeline_event_time":"1980","timeline_event_title":"Went on to sell Europe to rest of the world","timeline_event_type":"business-event"},"3":{"timeline_event_time":"1988","timeline_event_title":"Opening of 9 Further offices in Europe (24 in total).","timeline_event_type":"location-event"},"4":{"timeline_event_time":"1990","timeline_event_title":"Extended our portfolio of products to destinations in Middle East and Africa, + Online systems developed","timeline_event_type":"business-event"},"5":{"timeline_event_time":"1994","timeline_event_title":"vLaunch of REX - Online Hotel Reservation System","timeline_event_type":"service-event"}}}'; <div class="row"> <div class="container"> <ul class="timeline"> <li class="intro"> <span class="milestone-legend hidden"></span> <span class="milestone-year"> <ul class="intro-legend"> <li class="intro-image" style="background: url(' Notice: Undefined variable: variables in /in/riC03 on line 10 '); background-size: cover;"> </li> <li class="intro-text"> <p class="intro-heading"> </p> <p class="intro-statement"> </p> </li> </ul> </span> <span class="milestone-legend hidden"></span> </li> </ul> </div> </div>