php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44326 wrong assert output-phpt:php-5.2.5/ext/standard/tests/assert/assert_error1.phpt
Submitted: 2008-03-04 16:54 UTC Modified: 2008-04-04 01:00 UTC
From: eyal at zend dot com Assigned: fb-req-jani (profile)
Status: No Feedback Package: *General Issues
PHP Version: 5.2.5 OS: Linux any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eyal at zend dot com
New email:
PHP Version: OS:

 

 [2008-03-04 16:54 UTC] 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 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-05 02:34 UTC] felipe@php.net
Works fine here... Warnings are showed.
 [2008-03-27 09:51 UTC] jani@php.net
Did you set the "display_errors = On" and possibly "error_reporting = E_ALL" in your php.ini too?
 [2008-04-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC