Re: ZE2 / PHP 5 BC breaking suggestion
| From: | Andi Gutmans | Date: | Tue, 11 Jun 2002 19:07:18 +0000 |
| Subject: | Re: ZE2 / PHP 5 BC breaking suggestion | ||
| References: | 1 2 3 4 5 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-5528@lists.php.net to get a copy of this message | ||
At 07:39 PM 6/11/2002 +0200, Melvyn Sopacua wrote:
At 19:27 6/11/2002 +0300, Andi Gutmans wrote:Ah, now I understand what you meant :) No that isn't going to be deprecated in the near future. AndiAt 12:45 PM 6/11/2002 +0200, Manuzhai wrote:I think I got it: "$foo[bla]" -> but that wouldn't be a good idea.Using $bla[whatever] won't be deprecated inside "", will it?What do you mean?
The rule here is, that the outer quotes already specify a string type, so there's no question on whether the result is a string. Further more - constants are not supported inside double quotes, as it would really be hard to distinguish them from human text - for both humans and computers :-). So - there's never a conflict with constants and it would get really messy, in things like this: $sql = "SELECT * FROM table WHERE id='$_REQUEST[\'id\']'";I didn't quite understand the question. AndiAt 10:22 PM 6/10/2002 +0200, Melvyn Sopacua wrote:Manuzhai "Andi Gutmans" <andi@zend.com> wrote in message news:5.1.0.14.2.20020610233003.03b42990@127.0.0.1...At 20:35 10-6-2002, Andi Gutmans shared with all of us:Adding such an exception to the parser is definitely a no-no. AndiHmm, I see. I suppose (?<=\[)\w+(?=\]) as an exeption to accomodate those errorsThis 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.wouldbe too hard on the parser?Met vriendelijke groeten / With kind regards, IDG.nl Melvyn Sopacua Webmasterchanged.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 beisThe following: <?php if(UNDEFINED_CONSTANT) {//do stuff} ?> will result in do stuff being executed. I think it should be changed. Technically, anything not within quotescode: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 toif(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-2002Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua-- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php-- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php