#44326 [Opn->Fbk]: wrong assert output-phpt:php-5.2.5/ext/standard/tests/assert/assert_error1.phpt

From: Date: Thu, 27 Mar 2008 09:51:17 +0000
Subject: #44326 [Opn->Fbk]: wrong assert output-phpt:php-5.2.5/ext/standard/tests/assert/assert_error1.phpt
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123694@lists.php.net to get a copy of this message
ID: 44326 Updated by: jani@php.net Reported By: eyal at zend dot com -Status: Open +Status: Feedback Bug Type: *General Issues Operating System: Linux any PHP Version: 5.2.5 -Assigned To: +Assigned To: fb-req-jani New Comment: Did you set the "display_errors = On" and possibly "error_reporting = E_ALL" in your php.ini too? Previous Comments: ------------------------------------------------------------------------ [2008-03-05 02:34:40] felipe@php.net Works fine here... Warnings are showed. ------------------------------------------------------------------------ [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

« previous php.bugs (#123694) next »