# Can someone tell me ...

- Thread: https://externals.io/message/18373
- Original archive: https://news-web.php.net/php.internals/18373
- Started by John Coggeshall on 2005-08-24T18:15:59+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #18373 — John Coggeshall — 2005-08-24T18:15:59+00:00

URL: https://externals.io/message/18373#18373

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(); }'

---

## #18429 — Sven Peter — 2005-08-25T13:26:51+00:00

URL: https://externals.io/message/18373#18429 · In reply to: #18373

Hi,

> Why this crashes:
> 
> php -r 'class a { function b() { return $this->b(); }} $c = new a(); $c-
> > […]
> 
> 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
