summaryrefslogtreecommitdiff
path: root/ext/zend_test/tests/observer_opline_01.phpt
blob: d7d17f2b47747bfb2fd9119975889421c26cefbd (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/observer_opline_%d.php' -->
<!-- opcode: 'ZEND_INIT_FCALL' -->
<file '%s/observer_opline_%d.php'>
  <!-- opcode: 'ZEND_INIT_FCALL' -->
  <!-- init foo() -->
  <!-- opcode: 'ZEND_ECHO' -->
  <foo>
    <!-- opcode: 'ZEND_ECHO' -->
Foo
    <!-- opcode: 'ZEND_RETURN' -->
  </foo>
  <!-- init '%s/observer.inc' -->
  <!-- opcode: 'ZEND_INIT_FCALL' -->
  <file '%s/observer.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/observer.inc'>
6
  <foo>
    <!-- opcode: 'ZEND_ECHO' -->
Foo
    <!-- opcode: 'ZEND_RETURN' -->
  </foo>
  <!-- opcode: 'ZEND_RETURN' -->
</file '%s/observer_opline_%d.php'>