Re: [PHP4BETA] Incompatability in php4
| From: | Andi Gutmans | Date: | Wed, 08 Sep 1999 20:45:23 +0000 |
| Subject: | Re: [PHP4BETA] Incompatability in php4 | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4265@lists.php.net to get a copy of this message | ||
BTW, the fix I did just makes sure it follows the PHP 3.0 behaviour which means converting the floating point number to an integer.
You should probably do this yourself in your code so that you know what's going on.
Andi
At 03:38 PM 9/8/99 +0200, Jakub Skopal wrote:
Hi, try to surround the argument of the array subscription with IntVal(). Jakub 08.09.1999 v 14:01:38 (+0100), Nuno Loureiro napsal: Hi!!--- Andi Gutmans <andi@zend.com> http://www.zend.com/I had this piece of code working very well under php3, but it's notworking anymore under php4. ------------------------------------------------------ for($i=48;$i<=57;$i++)$digitos[]=$i;for($i=65;$i<=90;$i++)$letras[]=$i;for($i=97;$i<=122;$i++)$letras[]=$i;for ($i=0;$i<4;$i++) {srand((double)microtime()*1000000); $randval[] = chr($letras[(rand()/getrandmax())*count($letras)]);} for ($i=0;$i<2;$i++) {srand((double)microtime()*1000000); $randval[] = chr($digitos[(rand()/getrandmax())*count($digitos)]);} ------------------------------------------------------- It gave me this error (lines 282 and 286 are both randval lines in the code): Warning: Illegal offset type in include/functions.php3 on line 282 Warning: Illegal offset type in include/functions.php3 on line 282 Warning: Illegal offset type in include/functions.php3 on line 282 Warning: Illegal offset type in include/functions.php3 on line 282 Warning: Illegal offset type in include/functions.php3 on line 286 Warning: Illegal offset type in include/functions.php3 on line 286 Do you have any ideas why?! Best regards,Nuno Loureiro------------- Nuno Loureiro <nuno@eth.pt> Ethernet, Solucoes Informaticas, LDA. http://www.eth.pt -- PHP 4 Beta --Jakub "RiffRaff" Skopal mailto:j@kubs.cz