aximbigfan Posted May 7, 2008 Share Posted May 7, 2008 I have a function in a class that MUST return an integer. When I try th function by itself, it works, but when it is in the class, it returns a string. I have tried (int) in the return. Any ideas? Thanks, Chris Link to comment https://forums.phpfreaks.com/topic/104500-typecasts-not-holding-up-with-classes/ Share on other sites More sharing options...
trq Posted May 7, 2008 Share Posted May 7, 2008 Any ideas? Post some code? Link to comment https://forums.phpfreaks.com/topic/104500-typecasts-not-holding-up-with-classes/#findComment-534978 Share on other sites More sharing options...
aximbigfan Posted May 7, 2008 Author Share Posted May 7, 2008 public function remotereg($mode, $cat=null, $key=null, $val=null, $args=null ) { <some needless code> return (int)$output; } Note how I am using (int) to typcast it, but it still comes out as a string. Thanks! Chris Link to comment https://forums.phpfreaks.com/topic/104500-typecasts-not-holding-up-with-classes/#findComment-535203 Share on other sites More sharing options...
aximbigfan Posted May 8, 2008 Author Share Posted May 8, 2008 Bump. Chris Link to comment https://forums.phpfreaks.com/topic/104500-typecasts-not-holding-up-with-classes/#findComment-535640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.