NYCPHP Meetup

NYPHP.org

[nycphp-talk] Bug in PHundamentals function?

Dan Cech dcech at phpwerx.net
Mon Oct 3 21:12:26 EDT 2005


Aaron Fischer wrote:
> Chris Shiflett wrote:
>> Dan Cech wrote:
>>> return $sybase ? str_replace ("''", "'", $var) : stripslashes ($var);
>>
>> I prefer this approach when it helps me avoid escaping. In this case, I 
>> think both look confusing, but the escaping makes it worse.
>
> This looks better to me too (but what do I know?).

Yes, the double-quoted syntax is probably easier to understand in this 
case.  Honestly I never thought about it because single-quoted is what I 
usually use.

That said there may also be a (very slight) performance advantage to 
using the single-quoted version, given the fact that it's executed for 
every member (recursively) of every array affected by magic_quotes_gpc, 
for every page load.

Dan



More information about the talk mailing list