Re: Codebabes: PHP
| From: | Tiago Hori | Date: | Wed, 30 Apr 2014 00:11:00 +0000 |
| Subject: | Re: Codebabes: PHP | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323226@lists.php.net to get a copy of this message | ||
Still loving how we turned codebabes into something constructive!
Sent from my iPhone
> On Apr 29, 2014, at 8:28 PM, Tedd Sperling <tedd@sperling.com> wrote:
>
>> On Apr 29, 2014, at 9:11 AM, Daniel Brown <danbrown@php.net> wrote:
>>
>> To be fair, and to muddy-up the waters even more....
>>
>> echo 'echo'; // No parentheses needed....
>> echo('echo'); // .... but they can be used.
>> print('print'); // Seems common to see parentheses used here....
>> print 'print'; // .... but as a construct, they're not needed.
>> exit; // A language construct does not need parentheses....
>> exit(-1); // .... except in certain situations like this,
>> where data is passed.
>> continue; // However, there is yet another exception....
>> continue(2); // .... in that continue works with parentheses....
>> continue 2; // .... and without, but it is a control structure.
>> goto hell; // And yet, goto - another control structure - works....
>> goto(hell); // .... but only if you skip parentheses.
>>
>> --
>> </Daniel P. Brown>
>> Network Infrastructure Manager
>> http://www.php.net/
>
> Don't forget Ouch(); //... it returns "My head hurts."
>
> Also, with a function you can do this:
>
> $squareRoot = "sqrt";
> echo "The square root of 9 is " . $squareRoot(9); // a variable function
>
> But, you can't do the same with a construct:
>
> I want to go back to "I dunno" because that was simpler for me -- some things are
> just not meant to be learnt.
>
> Cheers,
>
> tedd
>
> _______________
> tedd sperling
> tedd@sperling.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>