From: [EMAIL PROTECTED]
Operating system: RH 7.2
PHP version: 4.3.0-pre1
PHP Bug Type: *General Issues
Bug description: assert() callback doesn't get expression
It looks like the callback function registered with assert_options() only
gets the third argument set when assert() is called with a string.
Consider the following script.
<?
function failedAssertion($file, $line, $expression)
{
print("'$file', '$line', '$expression'<br>");
}
assert_options(ASSERT_ACTIVE, TRUE);
assert_options(ASSERT_CALLBACK, "failedAssertion");
assert("1 == 2");
assert(1 == 2);
?>
This produces the following.
'/usr/local/apache/htdocs/tricks/assert.php', '9', '1 == 2'
'/usr/local/apache/htdocs/tricks/assert.php', '10', ''
If I turn error reporting on, the warning messages mirror this by leaving
out the expression.
Looks like the assert.phpt doesn't test assert() for the old form. Maybe
it needs a line like "assert($a != 0);".
--
Edit bug report at http://bugs.php.net/?id=20075&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20075&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20075&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20075&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20075&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20075&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20075&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20075&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20075&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20075&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20075&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20075&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20075&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20075&r=isapi