1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 13:01:02 +02:00
Files
archived-php-src/Zend/tests/traits/error_012.phpt
2015-05-17 17:31:43 -05:00

23 lines
359 B
PHP

--TEST--
Trying to access a protected trait method
--FILE--
<?php
trait foo {
public function test() { return 3; }
}
class bar {
use foo { test as protected; }
}
$x = new bar;
var_dump($x->test());
?>
--EXPECTF--
Fatal error: Uncaught Error: Call to protected method bar::test() from context '' in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d