1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Files
archived-php-src/tests/classes/ctor_dtor.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

39 lines
632 B
PHP

--TEST--
ZE2 The new constructor/destructor is called
--FILE--
<?php
class early {
function __construct() {
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->__construct();
unset($t);
$t = new late();
//unset($t); delay to end of script
echo "Done\n";
?>
--EXPECT--
early::__construct
early::__construct
early::__destruct
late::__construct
Done
late::__destruct