1--TEST-- 2Observer: Basic observability of closures 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 11$bar = function() { 12 var_dump(array_sum([40,2])); 13}; 14 15$foo = function($bar) { 16 echo 'Answer' . PHP_EOL; 17 $bar(); 18}; 19 20$foo($bar); 21$foo($bar); 22$foo($bar); 23 24echo 'DONE' . PHP_EOL; 25?> 26--EXPECTF-- 27<!-- init '%s%eobserver_closure_%d.php' --> 28<file '%s%eobserver_closure_%d.php'> 29 <!-- init {closure}() --> 30 <{closure}> 31Answer 32 <!-- init {closure}() --> 33 <{closure}> 34int(42) 35 </{closure}> 36 </{closure}> 37 <{closure}> 38Answer 39 <{closure}> 40int(42) 41 </{closure}> 42 </{closure}> 43 <{closure}> 44Answer 45 <{closure}> 46int(42) 47 </{closure}> 48 </{closure}> 49DONE 50</file '%s%eobserver_closure_%d.php'> 51