Re: array "sort()" question, weird php behavior ?
- From: "Arnaud" <nowhere@xxxxxxxxxxx>
- Date: Mon, 20 Jun 2005 14:47:03 +0200
<chernyshevsky@xxxxxxxxxxx> a écrit dans le message de news:
1119023866.369398.115180@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> The results you get is correct, given PHP's type conversion rules:
> When comparing a boolean to a number, PHP converts the number to a
> boolean. -1 becomes true. The order of elements with the same value
> after a quicksort is undefine, hence true could come before -1.
> When comparing a number to a string, PHP converts the string to a
> number. "test" becomes 0, which is bigger than -1 and less than 30.
Thanks a lot for the explanation,
bye
arnaud
.
- References:
- array "sort()" question, weird php behavior ?
- From: Arnaud
- Re: array "sort()" question, weird php behavior ?
- From: Chung Leong <chernyshevsky@xxxxxxxxxxx>
- array "sort()" question, weird php behavior ?
- Prev by Date: Re: are string matches in MySql normally case insenstive?
- Next by Date: Re: array "sort()" question, weird php behavior ?
- Previous by thread: Re: array "sort()" question, weird php behavior ?
- Next by thread: Re: array "sort()" question, weird php behavior ?
- Index(es):
Relevant Pages
|