3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $postarr = array('_parent_id' => null, '_year' => 2013); $data['post_type'] = "easy-photo-album"; if(!isset($postarr)){ print_r($data); } if($data['post_type'] == 'easy-photo-album') { $title = 'Undefined album'; if(isset($postarr['_parent_id']) && !empty($postarr['_parent_id'])){ $event = get_post($postarr['_parent_id']); $title = $event->post_title; } $title .= ' ['.$postarr['_year'].']'; $data['post_title'] = $title; } print_r($data);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [post_type] => easy-photo-album [post_title] => Undefined album [2013] )