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%eobserver_zend_call_function_%d.php' --> 23<file '%s%eobserver_zend_call_function_%d.php'> 24 <!-- init sum() --> 25 <sum> 26 </sum> 27 <sum> 28 </sum> 29 <sum> 30 </sum> 31 <sum> 32 </sum> 33 <sum> 34 </sum> 35int(15) 36Done 37</file '%s%eobserver_zend_call_function_%d.php'> 38