Help us understand the problem. What is going on with this article?

PHP + Xdebugの表示が崩れたときのその場しのぎ

More than 1 year has passed since last update.

phpでの開発中、偶にXdebugのエラー出力がhtmlタグの中に入り込んでうまく表示されない場合があるので困る。
なので↓のhtmlを作ってみた。
https://salty-eyrie-60368.herokuapp.com/

ソース【gistはこっち

xdebug.html
<!DOCTYPE html>
<html lang="ja">
    <head>
        <meta http-equiv="content-language" content="ja">
        <!-- 各自の環境に合わせて調整してね meta http-equiv="Content-Type" content="text/html; charset=UTF-8" -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
        <script>
            $(function(){
                $('#error_text').on('change, keyup', function(){
                    $('#error_view').html($('#error_text').val());
                });
            });
        </script>
        <title>HTML出力</title>
    </head>
    <body>
        <div>
            <textarea id='error_text' style="width:100%; height:500px;" placeholder="ここにエラーを貼り付ける"> 
            </textarea>
        </div>
        <div id='error_view'></div>
    </body>
</html>

たとえばこんなクソコード

test.php
<p>これはテストです</p>
<p class="<?php array_merge(1,2); ?>">たとえばclass名をphpで出力したときエラーになると</p>
<p>困る</p>

勿論エラーになる。可読性低し。
SS 4.png

なのでhtmlソースを表示してエラー部分をコピー。
SS 6.png

さっきのサイトでペーストしてみる。
SS 7.png

それっぽく表示されました。ハッピー。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away