xref: /PHP-5.6/Zend/tests/traits/language008a.phpt (revision b501570a)
1--TEST--
2Visibility can be changed with the as aliasing construct as well.
3--FILE--
4<?php
5error_reporting(E_ALL);
6
7trait HelloWorld {
8   public function sayHello() {
9     echo 'Hello World!';
10   }
11}
12
13class MyClass {
14   use HelloWorld { sayHello as protected; }
15}
16
17
18$o = new MyClass;
19$o->sayHello();
20
21?>
22--EXPECTF--
23Fatal error: Call to protected method MyClass::sayHello() from context '' in %s on line %d