Bug #80535 [NEW]: Backward compatibility issue - FATAL error
From: legrand101 at gmail dot com
Operating system:
PHP version: 8.0.0
Package: Reproducible crash
Bug Type: Bug
Bug description:Backward compatibility issue - FATAL error
Description:
------------
After upgrading to PHP 8, I start getting FATAL error for simple
statement that use to work on PHP 7. This statement is now producing a
FATAL error (PHP Fatal error: Uncaught Error: Attempt to modify
property on null) on PHP 8:
$T = &$r->country->state->city;
Before PHP8 both $r and properties (r->country, r->country->state,
r->country->state->city) are implicitly instantiated as standard classs
and $T is pointer.
Test script:
---------------
$T = &$r->country->state->city;
$T = 'home';
Expected result:
----------------
no fatal error. $r object implicitly created. $T and
$r->country->state->city value are 'home'.
var_dump($r);
object(stdClass)#34 (1) {
["country"]=>
object(stdClass)#36 (1) {
["state"]=>
object(stdClass)#37 (1) {
["city"]=>
&string(4) "home"
}
}
}
var_dump($T);
string(4) "home"
Actual result:
--------------
PHP Fatal error: Uncaught Error: Attempt to modify property on null
--
Edit bug report at https://bugs.php.net/bug.php?id=80535&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80535&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80535&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80535&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80535&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80535&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80535&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80535&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80535&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80535&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80535&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80535&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80535&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80535&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80535&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80535&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80535&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80535&r=mysqlcfg
Thread (10 messages)
- legrand101 at gmail dot com