1--TEST-- 2ASSIGN_OBJ on null reference returned from __get() 3--INI-- 4opcache.enable=1 5opcache.enable_cli=1 6opcache.file_update_protection=0 7opcache.jit_buffer_size=1M 8--FILE-- 9<?php 10class Test { 11 public $prop; 12 public function &__get($name) { 13 return $this->prop; 14 } 15} 16function test() { 17 $obj = new Test; 18 $obj->x->y = 1; 19} 20function test2() { 21 $obj = new Test; 22 $obj->x->y += 1; 23} 24try { 25 test(); 26} catch (Error $e) { 27 echo $e->getMessage(), "\n"; 28} 29try { 30 test2(); 31} catch (Error $e) { 32 echo $e->getMessage(), "\n"; 33} 34?> 35--EXPECT-- 36Attempt to assign property "y" on null 37Attempt to assign property "y" on null 38