ID:               44326
 Updated by:       [EMAIL PROTECTED]
 Reported By:      eyal at zend dot com
 Status:           Open
 Bug Type:         Unknown/Other Function
 Operating System: Linux any
 PHP Version:      5.2.5
 New Comment:

Works fine here... Warnings are showed.


Previous Comments:
------------------------------------------------------------------------

[2008-03-04 16:54:03] eyal at zend dot com

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 this bug report at http://bugs.php.net/?id=44326&edit=1

Reply via email to