2001-07-09 09:08:14 +00:00
|
|
|
--TEST--
|
|
|
|
assert()
|
2004-02-16 06:39:13 +00:00
|
|
|
--INI--
|
|
|
|
error_reporting = 2039
|
2001-07-09 09:08:14 +00:00
|
|
|
--FILE--
|
2001-10-06 09:38:29 +00:00
|
|
|
<?php
|
2001-07-09 10:20:41 +00:00
|
|
|
function a($file,$line,$myev)
|
|
|
|
{
|
|
|
|
echo "assertion failed $line,\"$myev\"\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
class a
|
|
|
|
{
|
|
|
|
function assert($file,$line,$myev)
|
|
|
|
{
|
|
|
|
echo "class assertion failed $line,\"$myev\"\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-07-09 09:08:14 +00:00
|
|
|
assert_options(ASSERT_ACTIVE,1);
|
|
|
|
assert_options(ASSERT_QUIET_EVAL,1);
|
|
|
|
assert_options(ASSERT_WARNING,0);
|
|
|
|
|
|
|
|
$a = 0;
|
2001-07-09 10:20:41 +00:00
|
|
|
|
|
|
|
assert_options(ASSERT_CALLBACK,"a");
|
|
|
|
assert('$a != 0');
|
|
|
|
|
|
|
|
assert_options(ASSERT_CALLBACK,array("a","assert"));
|
|
|
|
assert('$a != 0');
|
|
|
|
|
|
|
|
$obj = new a();
|
|
|
|
assert_options(ASSERT_CALLBACK,array(&$obj,"assert"));
|
2001-07-09 09:08:14 +00:00
|
|
|
assert('$a != 0');
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
2001-07-09 10:20:41 +00:00
|
|
|
assertion failed 22,"$a != 0"
|
|
|
|
class assertion failed 25,"$a != 0"
|
|
|
|
class assertion failed 29,"$a != 0"
|