0
0

phpでのvar_dump()表示形式変更

Posted at

注意:「 xdebug.so 」を読み込むと処理に時間がかかるようになるので、読み込むのは開発用/ステージングサーバーのみに絞った方が無難です。
時間的に約倍。下手すると倍超えまで時間がかかるようになります。

2023/07/04 AWS->OCIへのサーバー移行
※OCIサーバーでvar_dumpするとどのファイルの何行目かが分からないので。

今回のケースでは

[root@0206oci_webstaging php.d]# pwd
/etc/opt/remi/php56/php.d
[root@0206oci_webstaging php.d]# cat 20230704.ini
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
[root@0206oci_webstaging php.d]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
[root@0206oci_webstaging php.d]#
/etc/opt/remi/php56/php.d/20230704.ini

👆このファイルを新たに作成する。

テキスト形式での表示からHTML形式での表示に変更

テキスト形式

int(1)
string(12) "0.0000019073"
int(2)
string(12) "0.0002341270"
int(3)
string(12) "0.0036778450"
int(4)
string(12) "0.0000469685"
int(5)
string(12) "0.0001940727"
int(6)
string(12) "0.0003471375"
int(7)
string(12) "0.0000329018"
int(8)
string(12) "0.0000000000"
int(9)
string(12) "0.0182089806"
int(10)
string(12) "0.0029900074"
int(11)
string(12) "0.0001089573"
int(12)
string(12) "0.0013699532"
int(13)
string(12) "0.0003700256"
int(14)
string(12) "0.0002431870"
int(15)
string(12) "0.0000009537"
int(16)
string(12) "0.0182518959"
int(17)
string(12) "0.0027821064"
int(18)
string(12) "0.0000710487"
int(19)
string(12) "0.0012719631"
int(20)
string(12) "0.0003988743"
int(21)
string(12) "0.0000660419"

👇表示形式を変更
HTML形式

/home/myproject/app/modules/RootCateg.class.php:189:int 1
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0000019073' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 2
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0001780987' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 3
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0026531219' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 4
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0001118183' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 5
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0002090931' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 6
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0003890991' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 7
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0001769066' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 8
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0000019073' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 9
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0260870457' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 10
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0040071011' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 11
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0003168583' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 12
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0012071133' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 13
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0003249645' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 14
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0002679825' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 15
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0000019073' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 16
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0251791477' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 17
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0039210320' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 18
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0002818108' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 19
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0012140274' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 20
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0004310608' (length=12)
/home/myproject/app/modules/RootCateg.class.php:189:int 21
/home/myproject/app/modules/RootCateg.class.php:189:string '0.0002260208' (length=12)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0