You are here: Re: multiple stacks, multiple versions bother anybody, or is it just me? « PHP Programming Language « IT news, forums, messages
Re: multiple stacks, multiple versions bother anybody, or is it just me?

Posted by Oli Filth on 11/15/05 22:17

Jerry Stuckle said the following on 15/11/2005 20:02:
> Oli Filth wrote:
>
>> Jerry Stuckle said the following on 15/11/2005 17:09:
>>
>>>
>>> For instance, what is supposed to happen if you do something like:
>>>
>>> function f1 (&$i) {
>>> $i++;
>>> }
>>>
>>> Java and C++ handle this by not allowing a temporary to be passed as
>>> a reference (compiler error) - which is correct operation, IMHO.
>>
>>
>> However, even in Jerry's example, even without the benefit of const
>> enforcement, I don't see why PHP can't just assign to the temporary
>> variable - what harm would it do?
>
> But then let's take another case:
>
> f1(3);
>
> NOW what does f1 increment?

Good example!

In that case, I repeat my disappointment that PHP doesn't allow one the
option to indicate a constant reference!!

Alternatively, maybe PHP should throw an error if a literal is passed
(as in your 2nd example), but cope with temporary variables - although
there's probably a caveat I'm not seeing with that either...



--
Oli

 

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

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