Re: ZE2 / PHP 5 BC breaking suggestion

From: Date: Mon, 10 Jun 2002 20:30:30 +0000
Subject: Re: ZE2 / PHP 5 BC breaking suggestion
References: 1 2  Groups: php.qa 
Request: Send a blank email to php-qa+get-5516@lists.php.net to get a copy of this message
At 10:22 PM 6/10/2002 +0200, Melvyn Sopacua wrote:
At 20:35 10-6-2002, Andi Gutmans shared with all of us:
This is something which can't be broken because too many people use $a[foo] instead of $a['foo']. It'd kill a huge amount of web sites.
Hmm, I see. I suppose (?<=\[)\w+(?=\]) as an exeption to accomodate those errors would be too hard on the parser?
Adding such an exception to the parser is definitely a no-no. Andi
Andi At 09:29 PM 6/9/2002 +0200, Melvyn Sopacua wrote:
Hi, I know it's BC-breaking, but frankly - I do think it should be changed. The following: <?php if(UNDEFINED_CONSTANT) {
        //do stuff
} ?> will result in do stuff being executed. I think it should be changed. Technically, anything not within quotes is not a string. PHP however defaults to the string type when the characters are not in get_defined_constants(). This leads to unexpected behavior and people that do know, need to code: if(defined('SETTING_TRUE') && SETTING_TRUE)) which defeats using a constant in the first place. Comments please - especially if you know of a widely used php-package, which will break when this is changed. Met vriendelijke groeten / With kind regards, IDG.nl Melvyn Sopacua Webmaster -- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.370 / Virus Database: 205 - Release Date: 5-6-2002
Met vriendelijke groeten / With kind regards, IDG.nl Melvyn Sopacua Webmaster


« previous php.qa (#5516) next »