# bug 49348 - notice on $this->undefined++

- Thread: https://externals.io/message/65925
- Original archive: https://news-web.php.net/php.internals/65925
- Started by Stas Malyshev on 2013-02-19T09:23:03+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #65925 — Stas Malyshev — 2013-02-19T09:23:03+00:00

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

Hi!

I've created a pull to fix bug 49348 - when undefined properties do not
produce a notice when doing something like $this->undefined++, unlike
regular variables that do.

Unfortunately, this fix seems to require changing signature of
get_property_ptr_ptr(), adding fetch type, which makes it impossible for
5.4, and which would require any module that is compiled for 5.5 add
ifdefs if they override this handler (of course, I've fixed the ones in
the core). The pull is at: https://github.com/php/php-src/pull/281

However, I think that even though missing notice is not that big a deal,
having properties behaving inconsistently is, so this needs to be fixed.
Anybody has any objection or sees something wrong with the patch?

Also, if somebody has an idea of a better fix that won't require
changing the API, it's be nice, I couldn't think of any.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

---

## #65926 — Sherif Ramadan — 2013-02-19T09:32:41+00:00

URL: https://externals.io/message/65925#65926 · In reply to: #65925

On Tue, Feb 19, 2013 at 4:23 AM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:

> Hi!
>
> I've created a pull to fix bug 49348 - when undefined properties do not
> produce a notice when doing something like $this->undefined++, unlike
> regular variables that do.
>
> Unfortunately, this fix seems to require changing signature of
> get_property_ptr_ptr(), adding fetch type, which makes it impossible for
> 5.4, and which would require any module that is compiled for 5.5 add
> ifdefs if they override this handler (of course, I've fixed the ones in
> the core). The pull is at: https://github.com/php/php-src/pull/281
>
> However, I think that even though missing notice is not that big a deal,
> having properties behaving inconsistently is, so this needs to be fixed.
> Anybody has any objection or sees something wrong with the patch?
>
>
Looks like a reasonable fix to me. It's unfortunate it has to wait for 5.5,
but I couldn't think of a more clever fix that wouldn't break the API.


> Also, if somebody has an idea of a better fix that won't require
> changing the API, it's be nice, I couldn't think of any.
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227

---

## #65977 — Levi Morrison — 2013-02-19T17:46:20+00:00

URL: https://externals.io/message/65925#65977 · In reply to: #65925

> I've created a pull to fix bug 49348 - when undefined properties do not
> produce a notice when doing something like $this->undefined++, unlike
> regular variables that do.

I've been bitten by this from time to time. A notice would have been nice.

---

## #65991 — Dmitry Stogov — 2013-02-19T19:57:55+00:00

URL: https://externals.io/message/65925#65991 · In reply to: #65925

Hi Stas,

I'll take a look tomorrow or after tomorrow.
Sorry, quite busy.

Thanks. Dmitry.

On Tue, Feb 19, 2013 at 1:23 PM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:

> Hi!
>
> I've created a pull to fix bug 49348 - when undefined properties do not
> produce a notice when doing something like $this->undefined++, unlike
> regular variables that do.
>
> Unfortunately, this fix seems to require changing signature of
> get_property_ptr_ptr(), adding fetch type, which makes it impossible for
> 5.4, and which would require any module that is compiled for 5.5 add
> ifdefs if they override this handler (of course, I've fixed the ones in
> the core). The pull is at: https://github.com/php/php-src/pull/281
>
> However, I think that even though missing notice is not that big a deal,
> having properties behaving inconsistently is, so this needs to be fixed.
> Anybody has any objection or sees something wrong with the patch?
>
> Also, if somebody has an idea of a better fix that won't require
> changing the API, it's be nice, I couldn't think of any.
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227

---

## #66028 — Dmitry Stogov — 2013-02-20T08:38:05+00:00

URL: https://externals.io/message/65925#66028 · In reply to: #65925

Hi Stas,

The idea of the fix is fine (I didn't check all the related changes in PHP
extensions).
I think it must be included into 5.5.

Thanks. Dmitry.

On Tue, Feb 19, 2013 at 1:23 PM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:

> Hi!
>
> I've created a pull to fix bug 49348 - when undefined properties do not
> produce a notice when doing something like $this->undefined++, unlike
> regular variables that do.
>
> Unfortunately, this fix seems to require changing signature of
> get_property_ptr_ptr(), adding fetch type, which makes it impossible for
> 5.4, and which would require any module that is compiled for 5.5 add
> ifdefs if they override this handler (of course, I've fixed the ones in
> the core). The pull is at: https://github.com/php/php-src/pull/281
>
> However, I think that even though missing notice is not that big a deal,
> having properties behaving inconsistently is, so this needs to be fixed.
> Anybody has any objection or sees something wrong with the patch?
>
> Also, if somebody has an idea of a better fix that won't require
> changing the API, it's be nice, I couldn't think of any.
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227

---

## #66031 — Stas Malyshev — 2013-02-20T08:45:24+00:00

URL: https://externals.io/message/65925#66031 · In reply to: #66028

Hi!

> The idea of the fix is fine (I didn't check all the related changes in
> PHP extensions).
> I think it must be included into 5.5.

Thanks for reviewing it! If I don't head any objections in next couple
of days, I'll merge it to 5.5.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
