1--TEST-- 2Adding a class method object return type 3--FILE-- 4<?php 5 6interface One { 7 public function a() : object; 8} 9 10class Two implements One { 11 public function a() : object {} 12} 13 14$three = new class extends Two { 15 public function a() : object { 16 return 12345; 17 } 18}; 19$three->a(); 20?> 21--EXPECTF-- 22Fatal error: Uncaught TypeError: Two@anonymous::a(): Return value must be of type object, int returned in %s:%d 23Stack trace: 24#0 %s(%d): Two@anonymous->a() 25#1 {main} 26 thrown in %s on line 13 27