3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Template Name: トップページ */ ?> <?php get_header(); //header.phpを取得 ?> <div id="content" class="clearfix"> <aside> <?php get_sidebar(); //sidebar.phpを取得 ?> </aside> <article> <?php if ( have_posts() ) : //条件分岐:投稿があるなら ?> <?php while ( have_posts() ) : the_post();//繰り返し処理開始 ?> <section <?php post_class(); //投稿の種類に応じたクラスを付加 ?>> <h1><?php the_title(); //投稿(固定ページ)のタイトルを表示 ?></h1> <?php the_content(); //投稿(固定ページ)の本文を表示 ?> </section> <?php endwhile; // 繰り返し終了 ?> <?php else : //条件分岐:投稿が無い場合は ?> <h2>投稿がみつかりません。</h2> <p><a href="<?php echo home_url(); ?>">トップページに戻る</a></p> <?php endif; //条件分岐終了 ?> <section> <h2 class="section-title">NEWS</h2> <ul class="news-list"> <li> <span class="date">2016.01.15</span> <span class="label-info">お知らせ</span> <a href="#">新製品「魔法の便利ハサミ」の発表イベントを開催します。</a> </li> <li> <span class="date">2016.01.10</span> <span class="label-info">お知らせ</span> <a href="#">沢山のご要望により「らくらく便利シャープペンシル」の新カラーバリエーションを追加しました。</a> </li> <li> <span class="date">2016.01.01</span> <span class="label-info">お知らせ</span> <a href="#">スタッフブログにて社員の年始ご挨拶を掲載しています。</a> </li> </ul> <div class="center"> <a href="#" class="btn btn-default">お知らせ</a> </div> </section> </article> </div> <?php get_footer(); //footer.phpを取得 PHPで終了するので閉じタグは不要です
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function get_header() in /in/KaY1v:7 Stack trace: #0 {main} thrown in /in/KaY1v on line 7
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:
39.42 ms | 401 KiB | 8 Q