|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46913 Returning of bool types directly in return function returns null
Submitted: 2008-12-20 13:28 UTC Modified: 2008-12-28 01:00 UTC
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: OrminAPO at gmail dot com Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.2.8 OS: Windows XP Professional SP 2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-12-20 13:28 UTC] OrminAPO at gmail dot com
It doesn't returns bool type properly when bool type inserted into return.

Reproduce code:
function isLogged()

return true;
return false;

$log = isLogged(); // Returns NULL

Expected result:
$log = bool(false);

Actual result:
$log = null;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-20 13:29 UTC] OrminAPO at gmail dot com
Forgot to add - Function is from class, so examlple should be:
$log = $account->isLogged();
 [2008-12-20 15:55 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Please provide the complete reproduce script then.
 [2008-12-28 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-2023 The PHP Group
All rights reserved.
Last updated: Tue May 30 02:03:44 2023 UTC