1--TEST-- 2Test typed properties return by ref is allowed 3--FILE-- 4<?php 5$foo = new class { 6 public int $bar = 15; 7 8 public function &method() { 9 return $this->bar; 10 } 11}; 12 13var_dump($foo->method()); 14--EXPECT-- 15int(15) 16