Re: php seems to be inconsistent in its handling of backslashes ... maybe?

From: Date: Mon, 23 Apr 2007 13:36:04 +0000
Subject: Re: php seems to be inconsistent in its handling of backslashes ... maybe?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-253520@lists.php.net to get a copy of this message
On Apr 22, 2007, at 1:29 AM, Richard Lynch wrote:
On Sun, April 22, 2007 12:54 am, ufan100@gmail.com wrote:
-- or maybe it's just the PCRE extension -- or quite likely I have got something wrong Hello members, I'm hoping you could enlighten me. Using error_reporting = E_ALL | E_STRICT, I tested the following statements:
PHP interprets \\ inside of '' to turn \\ into \ It also tries to be halfway smart about mistakes with \ followed by some other non-special character, by just pretending you knew what you were doing and had \\ there to get just one \, even though you didn't.
Not that I can deny Richard's infinite knowledge of PHP (and it *eating* code), but is it PHP's responsibility to determine what the user has typed is (in)correct AND try to *fix* it? Shouldn't PHP just assume the programmer is not a complete idiot? If there's an error/warning/etc, throw it but don't correct it. My $.02. Feel free to set me straight - I'm always up for learning. ~Phil

« previous php.general (#253520) next »