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

Home » Imported messages » comp.lang.php » query: how many use PHP for linux scripts
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: query: how many use PHP for linux scripts [message #185930 is a reply to message #185926] Wed, 14 May 2014 22:10 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 14/05/14 22:18, Ben Bacarisse wrote:
> The Natural Philosopher <tnp(at)invalid(dot)invalid> writes:
>
>> On 14/05/14 19:00, Christoph Michael Becker wrote:
>>> The Natural Philosopher wrote:
>>>
>>>> On 14/05/14 13:39, Ben Bacarisse wrote:
> <snip>
>>>> > A PHP translation of C string handling would inevitably be simpler since
>>>> > there would be no need manage the storage. That's the biggest advantage
>>>> > in my opinion, even if never used any of PHP's more complex string
>>>> > manipulation.
>>>
>>> ACK.
>>>
>>>> when managing storage is no harder than
>>>>
>>>> char buf[1024];
>>>>
>>>> I cant see the issue.
>>>
>>> What happens when you store a string (say, user input) with more than
>>> 1023 bytes in buf? Oh, well, of course you won't--good luck.
>>>
>>
>> I make sure I don't.
>> strncpy...
>
> Well, I never saw that coming. You must be one of the few experienced C
> programmers to consider strncpy to be a solution for anything!
>
>> If I really dont know, well then calculate first and malloc.
>
> ...but then memory management is not a simple as a declaration (which is
> where this started). In PHP you need neither.
>

well there ya go.

IF I have a string too long for my buffers something has probably
already gone wrong.

And Id rather not push the system into swap - easier to say 'hey buffer
overflow' and abort.

With PHP, throw it too big a string and weirdness happens as it eats
into memory.



And you still need to do things like mysqli_free() to clear down data
structures.

Inconsistent.

> <snip>
>


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to get the POST name of a field in a form that uses a counter
Next Topic: PHP-SOAP/5.4.21 SoapClient terminating POST without waiting for reply, but still complaining "error fetching http headers".
Goto Forum:
  

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

Current Time: Sat Nov 30 10:58:04 GMT 2024

Total time taken to generate the page: 0.04190 seconds