1--TEST-- 2Getting parent class name when there is no parent generates an error 3--FILE-- 4<?php 5 6trait T { 7 public function f() { 8 var_dump(parent::class); 9 } 10} 11 12class C { 13 use T; 14} 15 16(new C)->f(); 17 18?> 19--EXPECTF-- 20Fatal error: Uncaught Error: Cannot use "parent" when current class scope has no parent in %s:5 21Stack trace: 22#0 %s(%d): C->f() 23#1 {main} 24 thrown in %s on line 5 25