1--TEST-- 2Trying to access a protected trait method 3--FILE-- 4<?php 5 6trait foo { 7 public function test() { return 3; } 8} 9 10class bar { 11 use foo { test as protected; } 12} 13 14$x = new bar; 15var_dump($x->test()); 16 17?> 18--EXPECTF-- 19Fatal error: Call to protected method bar::test() from context '' in %s on line %d 20