From:             eyal at zend dot com
Operating system: Linux any
PHP version:      5.2.5
PHP Bug Type:     Unknown/Other Function
Bug description:  wrong assert 
output-phpt:php-5.2.5/ext/standard/tests/assert/assert_error1.phpt

Description:
------------
The following was found when I used the code of a phpt via apache-module
php.
Requesting the script below returns the requested output as specified in
the phpt. However, second and third requests will result a different 
output with no error messages.

As specified in the phpt --INI-- section, I added the following directives
to my php.ini:
assert.active = 1
assert.warning = 1
assert.callback = f1
assert.quiet_eval = 1
assert.bail = 0


Reproduce code:
---------------
<?php
function f1()
{
        echo "f1 called\n";
}
function handler($errno, $errstr) {
        echo "in handler()\n\n";
        assert(E_RECOVERABLE_ERROR === $errno);
        var_dump($errstr);
}

//Wrong number of parameters for assert_options()
assert_options(ASSERT_WARNING, 1);
var_dump($rao=assert_options(ASSERT_CALLBACK,"f1",1));


//Unknown option for assert_options()
var_dump($rao=assert_options("F1","f1"));

//Wrong number of parameters for  assert()
$sa="0 != 0";
var_dump($r2=assert($sa,1));


//Catch recoverable error with handler
var_dump($rc=assert('aa=sd+as+safsafasfaçsafçsafç'));


Expected result:
----------------
Warning: Wrong parameter count for assert_options() in
/usr/local/zend/apache2/htdocs/assert.php on line 14
NULL

Warning: assert_options(): Unknown value 0 in
/usr/local/zend/apache2/htdocs/assert.php on line 18
bool(false)

Warning: Wrong parameter count for assert() in
/usr/local/zend/apache2/htdocs/assert.php on line 22
NULL


Actual result:
--------------
On second and third requests:
NULL bool(false) NULL 

-- 
Edit bug report at http://bugs.php.net/?id=44326&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44326&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44326&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44326&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44326&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44326&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44326&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44326&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44326&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44326&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44326&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44326&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44326&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44326&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44326&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44326&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44326&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44326&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44326&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44326&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44326&r=mysqlcfg

Reply via email to