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

From: Date: Fri, 09 May 2008 23:57:44 +0000
Subject: #44940 [Fbk->Csd]: Typecast does not work for function in class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124871@lists.php.net to get a copy of this message
ID: 44940 User updated by: blue765d at aol dot com Reported By: blue765d at aol dot com -Status: Feedback +Status: Closed Bug Type: Scripting Engine problem Operating System: WinXP PHP Version: 5.2.6 New Comment: Sorry, this is bogus. My mistake. I had a small typo in my code that caused it. Previous Comments: ------------------------------------------------------------------------ [2008-05-08 07:35:42] 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-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

« previous php.bugs (#124871) next »