1--TEST-- 2Reflection on closures: Segfaults with getParameters() and getDeclaringFunction() 3--FILE-- 4<?php 5 6$closure = function($a, $b = 0) { }; 7 8$method = new ReflectionMethod ($closure, '__invoke'); 9$params = $method->getParameters (); 10unset ($method); 11$method = $params[0]->getDeclaringFunction (); 12unset ($params); 13echo $method->getName ()."\n"; 14 15$parameter = new ReflectionParameter (array ($closure, '__invoke'), 'b'); 16$method = $parameter->getDeclaringFunction (); 17unset ($parameter); 18echo $method->getName ()."\n"; 19 20?> 21--EXPECT-- 22__invoke 23__invoke 24