PHP Debug : Basically Functions Of Xdebug
PHP Debug : Basically Functions Of Xdebug
Ref.]
https://opentutorials.org/course/692/3756
Ref.]
https://opentutorials.org/course/692/3756
- Xdebug's basically functions
- Context
- source code
123456789101112<?phpfunction fix_string($a){echo "Called @ ".xdebug_call_file()." : ".xdebug_call_line()." from ".xdebug_call_function();}$ret = fix_string(array('Shrek'));?>
cs - See Result

- source code
- Memory
- source code
12345678910<?php$text = "hello world";$prev_mem = xdebug_memory_usage();echo '<h1>메모리 체크</h1>';for( $i = 0 ; $i < 10 ; $i++ ){$text.=$text;echo 'seq : '.$i.' : xdebug_memory_usage = '.xdebug_memory_usage().' : xdebug_memory_usage-prev_memory = '.(xdebug_memory_usage()-$prev_mem).' : text : '.strlen($text)."\n";echo '<br/>';}?>
cs - See Result

- source code
- Excution Time
- source code
12345678<?phpecho '<h1>실행시간</h1>';for( $i = 0 ; $i < 3 ; $i++ ){echo xdebug_time_index().'<br/>';sleep(1);}?>
cs - view result

- source code
- Data Output
- source code
1234567891011121314151617181920212223242526<?phpclass test {public $publ = false;private $priv = true;protected $prot = 42;}$t = new test;$t -> publ = $t;$data = array('1' => 'just one','2' => array('2.1' => array('2.1.0' => 210,'2.1.1' => array('2.1.1.0' => 3.1415,'2.1.1.1' => 2.7,))),'3' => $t,'4' => range(0, 5),);var_dump($data);?>
cs - view result through web browser

- source code
- View Global Parameters
- source code
- Context