hi,
I agree with faisal with  using  for  or  while  with  the reference ,  not
only for performance but because using the reference with foreach may make
you so confused , I found this small example which most of people think it
is PHP bug but its Not:

<?php
   $a = array('zero','one','two');
    foreach( $a as &$v){
    }

  foreach( $a as $v){
  }


  print_r($a);
?>

// output :
Array
(
    [0] => zero
    [1] => one
    [2] => one
)

after the first loop finished pointer always point to the location a[2], so
in the second loop
first  iteration  :  zero ,one, zero
second iteration : zero,one, one
third  iteration  :  zero,one,one

regards,
hafez


On 1/28/07, Al-Faisal El-Dajani < [EMAIL PROTECTED]> wrote:
>
> This link demonstrates what i was just mentioning. Thanx to Tariq Abu Zaid
> for the info.
>
> http://www.php.lt/benchmark/phpbench.php
>
> --
> Al-Faisal El-Dajani
> Phone: +962-7-77 799 781
> P.O Box: 140056
> 11814 Amman, Jordan
> >
>


-- 
Hafez A.Ahmad
Amman-Jordan
mobile:962-785259011

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Jordan PHP Users Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/JoPHP
http://Jolug.org/
-~----------~----~----~----~------~----~------~--~---

Reply via email to