FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » return value?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: return value? [message #170889 is a reply to message #170887] Sun, 05 December 2010 14:48 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 12/5/2010 9:00 AM, Paul Fredlein wrote:
> Thomas 'PointedEars' Lahn<PointedEars(at)web(dot)de> wrote:
>
>> Paul Fredlein wrote:
>>
>>> Basic newbie question:-
>>>
>>> $value = "0";
>>> return $value;
>>>
>>> I assume that would return a string (or in this case one char with the
>>> hex value of 30) - is that right?
>>>
>>> $value = 0;
>>> return $value;
>>>
>>> What does this return? Is it a string, a short int (little endian or big
>>> endian) or what?
>>
>> Yes and yes. (Try the gettype() function, or var_dump()).
>>
>>
>> PointedEars

<Top posting fixed>

> Hi,
>
> I'm returning the variables to a C++ programme running on the client
> machine, I'm just a bit confused with php.
>
> If I return "1234" then I'm returning a string of 4 chars - 4 bytes,
> but if it's a short int then it's only 2 bytes. Seems wasteful to
> return more than I need to do.
>
> Thanks,
>
> Paul
>
>
<top posting fixed>

You're worried about 2 bytes on a machine which has hundreds of
megabytes (or even gigabytes)?

If you're that worried about performance, you shouldn't be using PHP in
the first place. You should be doing everything in C. Or

Quite frankly, I've never seen anyone so obsessed with premature
optimization as you are, Paul. The things you're considering
"important" are so small in the scheme of things that they will be
unnoticeable.

And please don't top post.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: what better book ?
Next Topic: PHP/AJAX Problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 15:50:30 GMT 2024

Total time taken to generate the page: 0.04181 seconds