|
Posted by Kimmo Laine on 02/16/07 06:37
"McKirahan" <News@McKirahan.com> wrote in message
news:FcidnT_ei-gIkUjYnZ2dnUVZ_syunZ2d@comcast.com...
> "shimmyshack" <matt.farey@gmail.com> wrote in message
> news:1171577754.774839.155030@a34g2000cwb.googlegroups.com...
> On Feb 15, 6:05 pm, Kimmo Laine <s...@outolempi.net> wrote:
>
> [snip]
>
>> "En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
>> s...@outolempi.net | Gedoon-S @ IRCnet | rot13(x...@bhgbyrzcv.arg)
>
> oh and of course, dont forget the other typo ,->. further on the same
> line!!
>
>
> Please notify the PHP Documentation Group; here's their example:
>
> Chapter 20. Exceptions
>
> Example 20-1. Throwing an Exception
>
> <?php
> try {
> $error = 'Always throw this error';
> throw new Exception($error);
>
> // Code following an exception is not executed.
> echo 'Never executed';
>
> } catch (Exception $e) {
> echo 'Caught exception: ', $e->getMessage(), "\n";
> }
The gag here is that when using a dot, you're concatenating two strings,
when using a comma your passing two (or more) arguments to echo, so the
comma thing only works with echo which is capable of recieveing arbitrary
number of parameters, unlike print for example. Thus print('foo','bar')
doesn't work while echo('foo','bar') does. Actually it might save just a
teeny bit of cpu cycles if the strings aren't concatenated but instead
passed as separate parameters. Go figure. For the sake of readability, using
dots consistently might be wise.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)
[Back to original message]
|