blob: 28586e4fdeac193499f5d51748094914cf91d224 (
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 Error: Call to protected method bar::test() from global scope in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
|