From:             AxelLuttgens at swing dot be
Operating system: Mac OS 10.3.4
PHP version:      4.3.8
PHP Bug Type:     Documentation problem
Bug description:  trigger_error() returns boolean

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'));



-- 
Edit bug report at http://bugs.php.net/?id=29273&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29273&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29273&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29273&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29273&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29273&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29273&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29273&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29273&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29273&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29273&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29273&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29273&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29273&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29273&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29273&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29273&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29273&r=float

Reply via email to