Re: [PHP4BETA] Incompatability in php4
| From: | Pavel Kalian | Date: | Wed, 08 Sep 1999 13:28:37 +0000 |
| Subject: | Re: [PHP4BETA] Incompatability in php4 | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4241@lists.php.net to get a copy of this message | ||
shouldn't the array offset be an integer?
Pavel
Nuno Loureiro wrote:
>
> Hi!!
>
> I had this piece of code working very well under php3, but it's not
> working 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