You are here: [from internals] Re: ref fix revisited « PHP « IT news, forums, messages
[from internals] Re: ref fix revisited

Posted by Jochem Maas on 10/21/84 11:27

hello Rasmus,

sorry to interrupt ... but ... could you possibly
spare a moment to explain why the SquirrelMail example you gave
is 'dumb' code? (I for one would like to avoid writing dumb code
wherever possible, and it looks a lot like I line I could have written!)

many thanks and regards,
jochem

Rasmus Lerdorf wrote:

....

>
> SquirrelMail has code like this all over the place:
>
> $value = strtolower(array_shift(split('/\w/',trim($value))));
>
> Here array_shift() does of course change the arg, so that is a potential
> problem. And yes, that's a dumb way to do this, but people write code
> like this. In some of these array manipulation calls, which seems to
> account for a number of the BC problems we are having, we could check
> for a non-ref and behave slightly differently. In the case of
> array_shift() we could return the first arg and throw a notice. Same
> would go for reset(), end(), next(), prev() and probably a few others.
>
> -Rasmus
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация