Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors',1);
- function __d($v, $var_dump = false, $xml_tidy = true){
- if (!$var_dump){
- $t = print_r($v,1);
- }
- else {
- ob_start();
- var_dump($v);
- $t=ob_get_clean();
- }
- if ($xml_tidy){
- $t = str_replace('><', ">\n<", $t);
- }
- $t = htmlentities($t);
- print '<hr><pre class="daggerhart">'.$t.'</pre>';
- }
- class foo {
- protected $t;
- function __construct(){
- $this->t = 't has a value';
- }
- function get_t(){
- print 'inside of get_t();';
- print __d($this);
- print 'leaving get_t()';
- return $this->t;
- }
- }
- class bar extends foo {
- function __construct(){
- print '$this->t';
- __d($this->t);
- print 'parent::get_t()';
- __d(parent::get_t());
- }
- }
- new bar();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement