- print_r: documentation ( source)
- register_shutdown_function: documentation ( source)
<?php
class foo {
var $my_public = array();
//forward php4 to constructor
function foo($one, $two) {
$this->my_public[] = 'php4 constructor';
return $this->__construct($one, $two);
}
//constructor php5
function __construct($one, $two) {
$this->my_public[] = 'php5 constructor';
$this->my_public[] = $one;
$this->my_public[] = $two;
register_shutdown_function(array(&$this, "__destruct"));
}
function dump() {
print_r($this->my_public);
}
function __destruct () {}
}
$test = new foo();
$test->dump();