1<?php 2function f1() { 3} 4 5if (isset($rt)) { 6 function f2() { 7 } 8} 9 10interface a { 11 function foo(); 12 function bar(); 13} 14interface b { 15 function foo(); 16} 17 18abstract class c { 19 function bar() { } 20} 21 22class x extends c implements a, b { 23 function foo() { } 24} 25 26trait T1 { 27 static function foo() { 28 var_dump(__METHOD__); 29 } 30} 31trait T2 { 32 use T1; 33 static function bar() { 34 var_dump(__METHOD__); 35 } 36} 37class Y { 38 use T2; 39} 40 41class Z { 42 public $foo; 43 public a $bar; 44} 45 46class Z2 extends Z {} 47 48class TraitAliasTest { 49 use T1 { 50 T1::foo as bar; 51 } 52} 53 54// Create reference to a property declared in an internal parent class. 55class MyException extends Exception { 56 public function __construct($message) { 57 $this->message =& $message; 58 } 59} 60 61function get_anon() { 62 return new class {}; 63} 64 65if (!isset($rt)) { 66 eval("class Foo {}"); 67 68 class Bar extends Foo {} 69 70 eval("function f3() {} "); 71} 72