summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/error_012.phpt
blob: ba1055e16170148914dbfc50acd84add0ebf3f22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--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 EngineException: Call to protected method bar::test() from context '' in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d