Re: echo VS print : that's a cool behavior !

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

 



That's just the case : "too see what happens if ...".

I agree that anyone will never meet such a case in everydays' programming.
;-)

2007/10/23, Andrew Ballard <aballard@xxxxxxxxx>:
>
> On 10/23/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
> > My bad, print is not a function, and so:
> >
> >     print( 'toctoc ' ).'hihi ';
> >
> > is equivalent to:
> >
> >     print( 'tocktoc '.'hihi ' );
> >
>
> Ah. I see. I knew they were optional, but I didn't know that when you
> include them PHP evaluates ('toctoc') before it passes the value off
> to print(). I just figured that with or without the parentheses it
> would pass 'toctoc' to print() and return a result that would be
> concatenated inline with the other values. I guess that's the part I
> didn't understand about the difference between a function and a
> language construct in PHP.
>
> As for the OP, I still don't know why anyone would even dream of
> creating code that does this other than "to see what would happen if
> we ...."  :-)
>
> Andrew
>
> --
> 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