forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobserver_basic_02.phpt
59 lines (56 loc) · 971 Bytes
/
observer_basic_02.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--TEST--
Observer: Basic observability of userland methods
--EXTENSIONS--
zend_test
--INI--
zend_test.observer.enabled=1
zend_test.observer.observe_all=1
--FILE--
<?php
class TestClass
{
private function bar()
{
echo 'Bar' . PHP_EOL;
var_dump(array_sum([1,2,3]));
}
public function foo()
{
echo 'Foo' . PHP_EOL;
$this->bar();
}
}
$test = new TestClass();
$test->foo();
$test->foo();
$test->foo();
echo 'DONE' . PHP_EOL;
?>
--EXPECTF--
<!-- init '%s%eobserver_basic_02.php' -->
<file '%s%eobserver_basic_02.php'>
<!-- init TestClass::foo() -->
<TestClass::foo>
Foo
<!-- init TestClass::bar() -->
<TestClass::bar>
Bar
int(6)
</TestClass::bar>
</TestClass::foo>
<TestClass::foo>
Foo
<TestClass::bar>
Bar
int(6)
</TestClass::bar>
</TestClass::foo>
<TestClass::foo>
Foo
<TestClass::bar>
Bar
int(6)
</TestClass::bar>
</TestClass::foo>
DONE
</file '%s%eobserver_basic_02.php'>