3v4l.org

run code in 300+ PHP versions simultaneously
<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 git.master, git.master_jit, rfc.property-hooks
<div id="right2"> Warning: Undefined variable $post in /in/t0RtB on line 4 Warning: Attempt to read property "ID" on null in /in/t0RtB on line 4 Warning: Undefined variable $post in /in/t0RtB on line 22 Warning: Attempt to read property "post_parent" on null 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.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.53 ms | 402 KiB | 8 Q