1--TEST--
2Observer: Basic observability of userland methods
3--EXTENSIONS--
4zend_test
5--INI--
6zend_test.observer.enabled=1
7zend_test.observer.show_output=1
8zend_test.observer.observe_all=1
9opcache.optimization_level=0x7FFFBFFF & ~0x0080
10--FILE--
11<?php
12class TestClass
13{
14    private function bar()
15    {
16        echo 'Bar' . PHP_EOL;
17        var_dump(array_sum([1,2,3]));
18    }
19
20    public function foo()
21    {
22        echo 'Foo' . PHP_EOL;
23        $this->bar();
24    }
25}
26
27$test = new TestClass();
28$test->foo();
29$test->foo();
30$test->foo();
31
32echo 'DONE' . PHP_EOL;
33?>
34--EXPECTF--
35<!-- init '%s%eobserver_basic_%d.php' -->
36<file '%s%eobserver_basic_%d.php'>
37  <!-- init TestClass::foo() -->
38  <TestClass::foo>
39Foo
40    <!-- init TestClass::bar() -->
41    <TestClass::bar>
42Bar
43      <!-- init array_sum() -->
44      <array_sum>
45      </array_sum>
46      <!-- init var_dump() -->
47      <var_dump>
48int(6)
49      </var_dump>
50    </TestClass::bar>
51  </TestClass::foo>
52  <TestClass::foo>
53Foo
54    <TestClass::bar>
55Bar
56      <array_sum>
57      </array_sum>
58      <var_dump>
59int(6)
60      </var_dump>
61    </TestClass::bar>
62  </TestClass::foo>
63  <TestClass::foo>
64Foo
65    <TestClass::bar>
66Bar
67      <array_sum>
68      </array_sum>
69      <var_dump>
70int(6)
71      </var_dump>
72    </TestClass::bar>
73  </TestClass::foo>
74DONE
75</file '%s%eobserver_basic_%d.php'>
76