php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44940 Typecast does not work for function in class
Submitted: 2008-05-08 03:59 UTC Modified: 2008-05-10 14:29 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: blue765d at aol dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.6 OS: WinXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: blue765d at aol dot com
New email:
PHP Version: OS:

 

 [2008-05-08 03:59 UTC] blue765d at aol dot com
Description:
------------
When a function in a class returns something that was typecasted, the typecast is ignored.

Reproduce code:
---------------
class test
{

public function foo()
{
$bar = "90";
return (int)$bar;
}

}



Expected result:
----------------
The expected result is for $bar to be returned as an integer. 

Actual result:
--------------
The actual result is that $bar is returned as a string.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-08 07:35 UTC] colder@php.net
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 give a complete reproduce script, so far your report looks bogous.
 [2008-05-09 23:57 UTC] blue765d at aol dot com
Sorry, this is bogus. My mistake. I had a small typo in my code that caused it.
 [2008-05-10 14:29 UTC] colder@php.net
ok, bogous then.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 16:01:36 2024 UTC