|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-12-20 16:11 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Package: Reproducible crash
+Package: Scripting Engine problem
-Assigned To:
+Assigned To: cmb
[2020-12-20 16:11 UTC] cmb@php.net
[2020-12-20 20:39 UTC] legrand101 at gmail dot com
[2020-12-20 23:14 UTC] cmb@php.net
[2020-12-21 00:35 UTC] legrand101 at gmail dot com
[2020-12-21 09:27 UTC] nikic@php.net
[2021-01-03 01:19 UTC] legrand101 at gmail dot com
[2021-01-03 01:34 UTC] legrand101 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 17:00:01 2025 UTC |
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