1--TEST-- 2Observer: Observability of fake closures 3--SKIPIF-- 4<?php if (!extension_loaded('zend-test')) die('skip: zend_test extension required'); ?> 5--INI-- 6zend_test.observer.enabled=1 7zend_test.observer.observe_all=1 8--FILE-- 9<?php 10class Foo 11{ 12 public function bar() 13 { 14 echo 'Called as fake closure.' . PHP_EOL; 15 } 16} 17 18$callable = [new Foo(), 'bar']; 19$closure = \Closure::fromCallable($callable); 20$closure(); 21 22echo 'DONE' . PHP_EOL; 23?> 24--EXPECTF-- 25<!-- init '%s%eobserver_closure_%d.php' --> 26<file '%s%eobserver_closure_%d.php'> 27 <!-- init Foo::bar() --> 28 <Foo::bar> 29Called as fake closure. 30 </Foo::bar> 31DONE 32</file '%s%eobserver_closure_%d.php'> 33