blob: 924c22b3a04b86377ec4a98c70ad65a2bfcfc268 (
plain)
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
|
--TEST--
Observer: Ensure opline exists on the execute_data
--SKIPIF--
<?php if (!extension_loaded('zend-test')) die('skip: zend-test extension required'); ?>
--INI--
zend_test.observer.enabled=1
zend_test.observer.observe_all=1
zend_test.observer.show_opcode=1
--FILE--
<?php
function foo()
{
echo 'Foo' . PHP_EOL;
}
foo();
include __DIR__ . '/observer.inc';
echo array_sum([1,2,3]) . PHP_EOL;
foo();
?>
--EXPECTF--
<!-- init '%s%eobserver_opline_%d.php' -->
<!-- opcode: 'ZEND_INIT_FCALL' -->
<file '%s%eobserver_opline_%d.php'>
<!-- opcode: 'ZEND_INIT_FCALL' -->
<!-- init foo() -->
<!-- opcode: 'ZEND_ECHO' -->
<foo>
<!-- opcode: 'ZEND_ECHO' -->
Foo
<!-- opcode: 'ZEND_RETURN' -->
</foo>
<!-- init '%s%eobserver.inc' -->
<!-- opcode: 'ZEND_INIT_FCALL' -->
<file '%s%eobserver.inc'>
<!-- opcode: 'ZEND_INIT_FCALL' -->
<!-- init foo_observer_test() -->
<!-- opcode: 'ZEND_ECHO' -->
<foo_observer_test>
<!-- opcode: 'ZEND_ECHO' -->
foo_observer_test
<!-- opcode: 'ZEND_RETURN' -->
</foo_observer_test>
<!-- opcode: 'ZEND_RETURN' -->
</file '%s%eobserver.inc'>
6
<foo>
<!-- opcode: 'ZEND_ECHO' -->
Foo
<!-- opcode: 'ZEND_RETURN' -->
</foo>
<!-- opcode: 'ZEND_RETURN' -->
</file '%s%eobserver_opline_%d.php'>
|