function early() {
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
}
- function __construct() {
- echo __CLASS__ . "::" . __FUNCTION__ . "\n";
- }
function __destruct() {
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
}
function __construct() {
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
}
- function late() {
- echo __CLASS__ . "::" . __FUNCTION__ . "\n";
- }
function __destruct() {
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
}
$t->early();
unset($t);
$t = new late();
-$t->late();
//unset($t); delay to end of script
echo "Done\n";
?>
--EXPECTF--
-early::__construct
+early::early
early::early
early::__destruct
late::__construct
-late::late
Done
late::__destruct
function __construct() {
var_dump('Base constructor');
}
-
- function Base_php5() {
- var_dump('I should not be called');
}
-}
class Child_php5 extends Base_php5 {
function __construct() {
var_dump('Child constructor');
parent::__construct();
}
-
- function Child_php5() {
- var_dump('I should not be called');
}
-}
class Child_mx1 extends Base_php4 {
function __construct() {