Re: Quick Poll: PHP 4 / 5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2005-09-18 at 16:10, Chris Shiflett wrote:
> Robert Cummings wrote:
> > I don't agree with your position that the above code is incorrect
> 
> I think notices are fine for situations where you've probably screwed 
> up. I'd rather PHP let me know than do nothing.
> 
> I see this situation as being very similar to the following:
> 
> <?php
> 
> function foo(&$bar)
> {
>      /* ... */
> }
> 
> foo(3);
> 
> ?>
> 
> This happens to throw a fatal error, which seems fine (mainly because it 
> always has, as far as I know, so no one can have working code that does 
> this sort of thing).
> 
> I'm curious to know whether you would also disagree that this code is 
> incorrect. I don't see a big fundamental difference, but I might be 
> misunderstanding something.

I have no argument about what you have shown above, but it becomes a
tricker question when you have the following which is similar but not
exactly what you have shown:

function foo( &$bar )
{
   /* ... */
}

function fee( $beer )
{
    return ($beer + 1);
}

foo( fee( 3 ) )

----

So the point being made here is that fee returns a variable container
(temporary or otherwise) and not a constant, however, with the new
system that is as incorrect as the foo( 3 ) you have expressed. Either
way, Rasmus has admitted that the new current system is a bit
aggressive, but points out (as do you) that it is better to generate a
notice just in case. And I already responded to that response by Rasmus'
with grudging agreement :)

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux