#44940 [Opn->Fbk]: Typecast does not work for function in class

From: Date: Thu, 08 May 2008 07:35:42 +0000
Subject: #44940 [Opn->Fbk]: Typecast does not work for function in class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124822@lists.php.net to get a copy of this message
 ID:               44940
 Updated by:       colder@php.net
 Reported By:      blue765d at aol dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Scripting Engine problem
 Operating System: WinXP
 PHP Version:      5.2.6
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2008-05-08 03:59:22] 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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44940&edit=1



Thread (4 messages)

« previous php.bugs (#124822) next »