xref: /php-src/ext/opcache/tests/preload.inc (revision 1bd6fafa)
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    #[A]
28    public $prop;
29
30    static function foo() {
31        var_dump(__METHOD__);
32    }
33}
34trait T2 {
35    use T1;
36    static function bar() {
37        var_dump(__METHOD__);
38    }
39}
40class Y {
41    use T2;
42}
43
44class Z {
45    public $foo;
46    public a $bar;
47}
48
49class Z2 extends Z {}
50
51class TraitAliasTest {
52    use T1 {
53        T1::foo as bar;
54    }
55}
56
57// Create reference to a property declared in an internal parent class.
58class MyException extends Exception {
59    public function __construct($message) {
60        $this->message =& $message;
61    }
62}
63
64function get_anon() {
65    return new class {};
66}
67
68if (!isset($rt)) {
69    eval("class Foo {}");
70
71    class Bar extends Foo {}
72
73    eval("function f3() {} ");
74}
75