Bug #80535 [Nab]: Backward compatibility issue - FATAL error

From: Date: Sun, 03 Jan 2021 01:34:43 +0000
Subject: Bug #80535 [Nab]: Backward compatibility issue - FATAL error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231338@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80535&edit=1

 ID:                 80535
 User updated by:    legrand101 at gmail dot com
 Reported by:        legrand101 at gmail dot com
 Summary:            Backward compatibility issue - FATAL error
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 PHP Version:        8.0.0
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

https://3v4l.org/H5SPf


Previous Comments:
------------------------------------------------------------------------
[2021-01-03 01:19:33] legrand101 at gmail dot com

Hi nikic,

https://3v4l.org/nkocf is different example than what is have.
Using a pointer will work(there's no warning for that until 7.4.0). See https://3v4l.org/H5SPf.

------------------------------------------------------------------------
[2020-12-21 09:27:43] nikic@php.net

Worth noting that this warning is actually very old (dating back all the way to PHP 5.0: https://3v4l.org/nkocf). PHP 7.4 fixed a special case where the
warning was missing (references as opposed to direct writes) and PHP 8.0 removed this functionality
completely.

Note that auto-vivification is still supported for arrays (and I don't believe there are plans
to remove it there).

------------------------------------------------------------------------
[2020-12-21 00:35:58] legrand101 at gmail dot com

This is project personal I started more three years ago, so it's no big deal for me. I just
revert back to PHP7. I only wanted to checkout the performance improvements.

Even though, it's unlike to be reverted, I would like to add this issue to the internals
mailing list. I don't see why making more things more restrictive is an improvement. How do I
bring it up to the internals mailing list?

------------------------------------------------------------------------
[2020-12-20 23:14:01] cmb@php.net

> So, is there any work around other than explicitly instantiating
> each variable.

I don't think so.  If you strongly feel that this "feature" should
not have been disallowed, please raise that on the internals
mailing list, although I consider it unlikely that the change will
be reverted.

> there is a reason to introduce warnings years before

In this case it has been only *one* year.

------------------------------------------------------------------------
[2020-12-20 20:39:14] legrand101 at gmail dot com

Thanks for the quick response. I was upgrading from PHP7.0 so didn't get any warnings. By
crash, I meant the my script was crashing.

So, is there any work around other than explicitly instantiating each variable. This seems like a
big inconvenience, special if one relied this behavior for API development.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=80535


--
Edit this bug report at https://bugs.php.net/bug.php?id=80535&edit=1


Thread (10 messages)

« previous php.bugs (#231338) next »