Re: Codebabes: PHP

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

 



2014-04-29 15:11 GMT+02:00 Daniel Brown <danbrown@xxxxxxx>:

> On Tue, Apr 29, 2014 at 8:45 AM, Sebastian Krebs <krebs.seb@xxxxxxxxx>
> wrote:
> > 2014-04-29 14:33 GMT+02:00 Tedd Sperling <tedd@xxxxxxxxxxxx>:
> >>
> >> As for "print" being a function or construct, I dunno -- what's the
> >> difference?
> >
> > In the real world: You can never use functions without the paranthesis,
> but
> > you can never use language constructs as callbacks.
>
>     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.
>

? control structures are language constructs too :? So of course it works
this way.



>         goto hell; // And yet, goto - another control structure - works....
>         goto(hell); // .... but only if you skip parentheses.
>

And yet there are difference, of course ;) "class" is also a language
construct, but still you can't write

class (foo) extends (bar) {}


>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
>



-- 
github.com/KingCrunch

[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