2003-03-03 11:18:59 +00:00
|
|
|
--TEST--
|
2003-08-09 14:48:47 +00:00
|
|
|
ZE2 The new constructor/destructor is called
|
2003-03-03 11:18:59 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class early {
|
|
|
|
function early() {
|
|
|
|
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
|
|
|
|
}
|
|
|
|
function __destruct() {
|
|
|
|
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class late {
|
|
|
|
function __construct() {
|
|
|
|
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
|
|
|
|
}
|
|
|
|
function __destruct() {
|
|
|
|
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$t = new early();
|
|
|
|
$t->early();
|
|
|
|
unset($t);
|
|
|
|
$t = new late();
|
|
|
|
//unset($t); delay to end of script
|
|
|
|
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2004-03-05 12:18:16 +00:00
|
|
|
early::early
|
2003-03-03 11:18:59 +00:00
|
|
|
early::early
|
|
|
|
early::__destruct
|
|
|
|
late::__construct
|
|
|
|
Done
|
|
|
|
late::__destruct
|