|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-25 00:30 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 21:00:01 2025 UTC |
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);".