1--TEST--
2Observer: Calls that go through zend_call_function are observed
3--EXTENSIONS--
4zend_test
5--INI--
6zend_test.observer.enabled=1
7zend_test.observer.show_output=1
8zend_test.observer.observe_all=1
9--FILE--
10<?php
11function sum($carry, $item) {
12    $carry += $item;
13    return $carry;
14}
15
16$a = [1, 2, 3, 4, 5];
17// array_reduce() calls zend_call_function() under the hood
18var_dump(array_reduce($a, 'sum'));
19echo 'Done' . PHP_EOL;
20?>
21--EXPECTF--
22<!-- init '%s' -->
23<file '%s'>
24  <!-- init array_reduce() -->
25  <array_reduce>
26    <!-- init sum() -->
27    <sum>
28    </sum>
29    <sum>
30    </sum>
31    <sum>
32    </sum>
33    <sum>
34    </sum>
35    <sum>
36    </sum>
37  </array_reduce>
38  <!-- init var_dump() -->
39  <var_dump>
40int(15)
41  </var_dump>
42Done
43</file '%s'>
44