Re: [PHP4BETA] PHP 3 syntax imcompatibilities
| From: | Andi Gutmans | Date: | Mon, 20 Dec 1999 05:38:33 +0000 |
| Subject: | Re: [PHP4BETA] PHP 3 syntax imcompatibilities | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-8198@lists.php.net to get a copy of this message | ||
In PHP 4 {$ in encapsulated strings tells PHP 4 that it should be expecting something like {$variable}. This was done because now in PHP 4 within { } in your encapsed strings you aren't limited with your variables anymore but can go wild with multi-dimensional arrays.
Try to escape the {$ with \{$
Andi
At 10:08 PM 12/19/99 +0000, Manuel Lemos wrote:
Hello, Recently I was brought to the attention that there are some syntax problems in my forms class that hundreds of users have downloaded from here: http://phpclasses.UpperDesign.com/browse.html/package/1 The problem is that I am not sure what exactly uses on it syntax that was legal on PHP 3 but is not legal at least in PHP 4 beta 3. I have pasted the part of the code that apparently offend the PHP 4 syntax. I wonder if anybody can tell me what and why I can't use this syntax in PHP 4 despite I could in PHP 3. $function("function $validate_as_email(theinput)$jseol{$jseol"); $function("\ts=theinput.value$jseol\tif(s.search)$jseol\t{$jseol\t\treturn (s.search(new RegExp(\"".$this->EscapeJavascriptRegularExpressions($this->email_regular_e xpression)."\",\"gi\"))>=0)$jseol\t}$jseol"); $function("\tif(s.indexOf)$jseol\t{$jseol\t\tat_character=s.indexOf('@')$js eol\t\tif(at_character<=0 || at_character+4>s.length)$jseol\t\t\treturn false$jseol\t}$jseol"); $function("\tif(s.length<6)$jseol\t\treturn false$jseol\telse$jseol\t\treturn true$jseol}$jseol"); Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp -- -- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net--- Andi Gutmans <andi@zend.com> http://www.zend.com/