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 #170897 is a reply to message #170889] Mon, 06 December 2010 07:58 Go to previous messageGo to previous message
paulfredlein is currently offline  paulfredlein
Messages: 8
Registered: December 2010
Karma:
Junior Member
Hi,

I grew up in DOS where every byte counts.

It's not the capacity of the client, it's the data travelling through
the 'ether'.

I'll just return everything as strings and extract it as needed.

Thanks

Paul


Jerry Stuckle <jstucklex(at)attglobal(dot)net> wrote:

> 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.
[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 21:26:55 GMT 2024

Total time taken to generate the page: 0.04437 seconds