Bug #78779 [Fbk]: Null Coalescing Operator: Trying to access array offset on value of type null

From: Date: Sat, 07 Dec 2019 19:07:59 +0000
Subject: Bug #78779 [Fbk]: Null Coalescing Operator: Trying to access array offset on value of type null
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224117@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78779&edit=1

 ID:                 78779
 Updated by:         requinix@php.net
 Reported by:        bugreport2 at gmail dot com
 Summary:            Null Coalescing Operator: Trying to access array
                     offset on value of type null
 Status:             Feedback
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        7.4Git-2019-11-04 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

@kevin-anidjar: That does not reproduce the issue. The code must use ?? immediately after a value
and without that value going through a function.


Previous Comments:
------------------------------------------------------------------------
[2019-12-07 19:07:35] bugreports3 at gmail dot com

sadly "echo strval($arr['foo']) ?? 'bar';" is a invalid reproducer and
expected to thow a warning becaus ein that line strval() is feeded with $arr['foo'] and
"?? 'bar'" would only be relevant wehn that returns NULL which is not possible
by the nature of strval()

this is a completly different beast
$oldcontent = $arr[0] ?? '';

------------------------------------------------------------------------
[2019-12-07 19:01:14] contact at kevin-anidjar dot com

Hi, here is a way to reproduce the issue:

https://3v4l.org/mX3Pf

------------------------------------------------------------------------
[2019-12-04 09:31:44] nikic@php.net

Unless there's some working reproduction code for this, I don't think we can do anything
here.

------------------------------------------------------------------------
[2019-11-17 11:41:35] cmb@php.net

Opening, since feedback had been provided.

------------------------------------------------------------------------
[2019-11-17 04:22:05] php-bugs at lists dot php dot net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.

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


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=78779


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


Thread (13 messages)

« previous php.bugs (#224117) next »