Can someone tell me ...

php.internals

John Coggeshall

21 years ago
Why this crashes: php -r 'class a { function b() { return $this->b(); }} $c = new a(); $c-
>b();'
and this does not? php -r 'function a() { return a(); }'

Sven Peter

21 years ago
Hi,
> Why this crashes: > > php -r 'class a { function b() { return $this->b(); }} $c = new a(); $c- > >b();' > > and this does not? > > php -r 'function a() { return a(); }'
because you forgot to call a(); This also crashes: php -r "function a() { return a(); } a();" Sven