3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<div id="right2"> <?php if($post->ID==13) { $galleries = $wpdb->get_results('SELECT * FROM wp_ngg_gallery WHERE gid > 1 ORDER BY name;', OBJECT); echo "<a href=/?page_id=13>Gallery</a><br />"; echo "<ul>"; foreach ($galleries as $row) { echo "<li><a href=/?page_id=13&amp;album=1&amp;gallery=".$row->gid.">".$row->title."</a></li>"; } echo "</ul>"; } else { if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { $galleries = $wpdb->get_results('SELECT p1.post_title, p1.post_parent, p2.post_title as parent_title FROM wp_posts as p1 LEFT OUTER JOIN wp_posts as p2 ON (p1.post_parent=p2.id) WHERE p1.id = '.$post->ID.';', OBJECT); foreach ($galleries as $row) { if ($row->post_parent > 0) echo "<a href=/?page_id=".$row->post_parent.">".$row->parent_title."</a>"; else echo "<a href=/?page_id=".$post->ID.">".$row->post_title."</a>"; } echo "<ul>"; echo $children; echo "</ul>"; } } ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?> <?php endif; ?> </div> <!-- end right 2 -->
Output for 7.0.0 - 7.1.0
<div id="right2"> Notice: Undefined variable: post in /in/t0RtB on line 4 Notice: Trying to get property of non-object in /in/t0RtB on line 4 Notice: Undefined variable: post in /in/t0RtB on line 22 Notice: Trying to get property of non-object in /in/t0RtB on line 22 Fatal error: Uncaught Error: Call to undefined function wp_list_pages() in /in/t0RtB:25 Stack trace: #0 {main} thrown in /in/t0RtB on line 25
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
<div id="right2"> Notice: Undefined variable: post in /in/t0RtB on line 4 Notice: Cannot access property on non-object in /in/t0RtB on line 4 Notice: Undefined variable: post in /in/t0RtB on line 22 Notice: Cannot access property on non-object in /in/t0RtB on line 22 Fatal error: Call to undefined function wp_list_pages() in /in/t0RtB on line 25
Process exited with code 255.
Output for 5.0.4 - 5.6.28
<div id="right2"> Notice: Undefined variable: post in /in/t0RtB on line 4 Notice: Trying to get property of non-object in /in/t0RtB on line 4 Notice: Undefined variable: post in /in/t0RtB on line 22 Notice: Trying to get property of non-object in /in/t0RtB on line 22 Fatal error: Call to undefined function wp_list_pages() in /in/t0RtB on line 25
Process exited with code 255.
Output for 5.0.0 - 5.0.3
<div id="right2"> Notice: Undefined variable: post in /in/t0RtB on line 4 Notice: Trying to get property of non-object in /in/t0RtB on line 4 Notice: Undefined variable: post in /in/t0RtB on line 22 Notice: Trying to get property of non-object in /in/t0RtB on line 22 Fatal error: Call to undefined function wp_list_pages() in /in/t0RtB on line 25
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<div id="right2"> Notice: Undefined variable: post in /in/t0RtB on line 4 Notice: Undefined variable: post in /in/t0RtB on line 22 Fatal error: Call to undefined function: wp_list_pages() in /in/t0RtB on line 25
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<div id="right2"> Notice: Undefined variable: post in /in/t0RtB on line 4 Notice: Undefined variable: post in /in/t0RtB on line 22 Fatal error: Call to undefined function: wp_list_pages() in /in/t0RtB on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<div id="right2"> Notice: Undefined variable: post in /in/t0RtB on line 4 Notice: Undefined variable: post in /in/t0RtB on line 22 Fatal error: Call to undefined function: wp_list_pages() in /in/t0RtB on line 25