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