# Assigning to $this

- Thread: https://externals.io/message/7534
- Original archive: https://news-web.php.net/php.internals/7534
- Started by Jan Lehnardt on 2004-02-04T13:16:42+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

---

## #7534 — Jan Lehnardt — 2004-02-04T13:16:42+00:00

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

Hi,
I was just wondering. An assignment to $this is not longer possible
in PHP 5. This was agreed upon and everything is fine with that.
However, when trying to assign to $this in PHP 5, this assignment
is silently ignored. I thought it might be useful, or even needed
to issue a notice there. I first thought this was a candidate for
E_STRICT, but now I think it should notice the user at a lower level
already.

Any opinions?

Jan

---

## #7535 — Zeev Suraski — 2004-02-04T13:57:10+00:00

URL: https://externals.io/message/7534#7535 · In reply to: #7534

Good idea.  I added a fatal error. The reason is that there's pretty much 
no chance that someone was doing this and his script will continue working. 
This is definitely something which needs to be fixed by the app developer.

Andi

At 15:16 04/02/2004, Jan Lehnardt wrote:
>Hi,
>I was just wondering. An assignment to $this is not longer possible
>in PHP 5. This was agreed upon and everything is fine with that.
>However, when trying to assign to $this in PHP 5, this assignment
>is silently ignored. I thought it might be useful, or even needed
>to issue a notice there. I first thought this was a candidate for
>E_STRICT, but now I think it should notice the user at a lower level
>already.
>
>Any opinions?
>
>Jan
