php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54424 failed assert with ASSERT_BAIL exits with return code == 0
Submitted: 2011-03-30 15:04 UTC Modified: -
Votes:6
Avg. Score:4.3 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:4 (66.7%)
From: jakub dot lopuszanski at nasza-klasa dot pl Assigned:
Status: Open Package: *General Issues
PHP Version: 5.3.6 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-03-30 15:04 UTC] jakub dot lopuszanski at nasza-klasa dot pl
Description:
------------
Failed assertions should be signaled by non-zero return code from the script as they are errors.

Test script:
---------------
$ cat example.php
<?php
assert_options(ASSERT_BAIL,     true);
assert(false);
?>
$ php example.php
PHP Warning:  assert(): Assertion failed in /home/lopuszanski/projects/NK-2/tests/php/example.php on line 3
$ echo $?
0

Expected result:
----------------
echo $? should display some nonzero return code

Actual result:
--------------
0

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 21:01:27 2019 UTC