php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #29273 trigger_error() returns boolean
Submitted: 2004-07-20 10:46 UTC Modified: 2004-07-20 12:04 UTC
From: AxelLuttgens at swing dot be Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.8 OS: Mac OS 10.3.4
Private report: No CVE-ID: None
 [2004-07-20 10:46 UTC] AxelLuttgens at swing dot be
Description:
------------
The documentation for trigger_error() indicates:

    void trigger_error ( string error_msg [, int error_type])

But trigger_error() seems to return TRUE on my system.

Now, I find it handy to have trigger_error() as a true function (as opposed to "language constructs", which often tend to make code more convoluted than needed).

But does it always return TRUE?
Or may it sometimes return FALSE?
Or is it a bug in the code, the documentation then being correct?

Reproduce code:
---------------
# both print "1" on my system
echo is_bool(trigger_error('a triggered one'));
echo trigger_error('a triggered one') === TRUE;

Expected result:
----------------
# According to the documentation, I would have expected
# something like this:
# this would print ""
echo is_bool(trigger_error('a triggered one'));
# this would print "1"
echo is_null(trigger_error('a triggered one'));



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-20 11:55 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

This function returns false if wrong error_type is specified, true otherwise.
 [2004-07-20 12:04 UTC] AxelLuttgens at swing dot be
Thanks for your quick and precise reply,
Axel
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Aug 03 21:00:03 2025 UTC