/php-src/Zend/ |
H A D | zend_closures.c | 126 zend_closure *closure; in ZEND_METHOD() local 166 GC_DELREF(&closure->std); in ZEND_METHOD() 494 return &closure->func; in zend_get_closure_method_def() 501 return &closure->this_ptr; in zend_get_closure_this_ptr() 540 zend_closure *closure; in zend_closure_new() local 557 closure->func.common.scope, closure->called_scope, &closure->this_ptr); in zend_closure_clone() 566 *fptr_ptr = &closure->func; in zend_closure_get_closure() 687 *table = Z_TYPE(closure->this_ptr) != IS_NULL ? &closure->this_ptr : NULL; in zend_closure_get_gc() 733 zend_closure *closure; in zend_create_closure_ex() local 810 closure->orig_internal_handler = closure->func.internal_function.handler; in zend_create_closure_ex() [all …]
|
/php-src/ext/zend_test/tests/ |
H A D | observer_closure_01.phpt | 31 <{closure:%s:%d}> 34 <{closure:%s:%d}> 42 </{closure:%s:%d}> 43 </{closure:%s:%d}> 44 <{closure:%s:%d}> 46 <{closure:%s:%d}> 52 </{closure:%s:%d}> 53 </{closure:%s:%d}> 54 <{closure:%s:%d}> 56 <{closure:%s:%d}> [all …]
|
/php-src/ext/reflection/tests/ |
H A D | gh10623.phpt | 10 $closure = function($var) use($data1) {}; 11 var_dump((new ReflectionFunction($closure))->getClosureUsedVariables()); 13 $closure = function($var, ...$variadic) {}; 14 var_dump((new ReflectionFunction($closure))->getClosureUsedVariables()); 16 $closure = function($var, ...$variadic) use($data1) {}; 17 var_dump((new ReflectionFunction($closure))->getClosureUsedVariables()); 19 $closure = function($var, ...$variadic) use($data1, $data2, $data3) {}; 20 var_dump((new ReflectionFunction($closure))->getClosureUsedVariables()); 22 $closure = function(...$variadic) use($data1) {}; 23 var_dump((new ReflectionFunction($closure))->getClosureUsedVariables()); [all …]
|
H A D | closures_004.phpt | 2 Reflection on closures: Segfault with getClosure() on closure itself 5 $closure = function() { echo "Invoked!\n"; }; 7 $method = new ReflectionFunction ($closure); 14 unset ($closure); 19 $closure = function() { echo "Invoked!\n"; }; 21 $method = new ReflectionMethod ($closure, '__invoke'); 22 $closure2 = $method->getClosure ($closure); 27 unset ($closure);
|
H A D | bug66430.phpt | 2 Bug #66430: ReflectionFunction::invoke does not invoke closure with object scope 21 $closure = $method->getClosure($alpha); 23 $reflectionC = new ReflectionFunction($closure); 26 echo "closure of alpha.bravo: ", $closure().PHP_EOL; 27 echo "call_user_func of closure: ", call_user_func($closure).PHP_EOL; 29 echo "closure cl of c(alpha.bravo): ", get_class($reflectionC->getClosureThis()).PHP_EOL; 37 closure of alpha.bravo: Valid representation 38 call_user_func of closure: Valid representation 40 closure cl of c(alpha.bravo): Alpha
|
H A D | closures_001.phpt | 6 $closure = function($a, $b = 0) { }; 8 $ro = new ReflectionObject($closure); 22 $rm = new ReflectionMethod($closure, '__invoke'); 29 $rp = new ReflectionParameter(array($closure, '__invoke'), 0); 31 $rp = new ReflectionParameter(array($closure, '__invoke'), 1); 33 $rp = new ReflectionParameter(array($closure, '__invoke'), 'a'); 35 $rp = new ReflectionParameter(array($closure, '__invoke'), 'b'); 40 $rp = new ReflectionParameter($closure, 0); 42 $rp = new ReflectionParameter($closure, 1); 44 $rp = new ReflectionParameter($closure, 'a'); [all …]
|
H A D | ReflectionFunction_getClosureScopeClass.phpt | 5 $closure = function($param) { return "this is a closure"; }; 6 $rf = new ReflectionFunction($closure); 11 return function($param) { return "this is a closure"; }; 15 $closure = A::getClosure(); 16 $rf = new ReflectionFunction($closure);
|
H A D | closures_003_v1.phpt | 6 $closure = function($a, $b = 0) { }; 8 $method = new ReflectionFunction ($closure); 15 $parameter = new ReflectionParameter ($closure, 'b'); 22 {closure:%s:%d} 23 {closure:%s:%d}
|
H A D | bug52057.phpt | 6 $closure = function($a) { echo $a; }; 8 $reflection = new ReflectionClass('closure'); 11 $reflection = new ReflectionClass($closure); 14 $reflection = new ReflectionObject($closure); 17 $reflection = new ReflectionClass('closure'); 21 $reflection = new ReflectionClass($closure); 25 $reflection = new ReflectionObject($closure);
|
H A D | ReflectionGenerator_in_Generator.phpt | 40 string(%d) "{closure:%s:%d}" 50 string(%d) "{closure:%s:%d}" 54 string(%d) "{closure:%s:%d}" 65 string(%d) "{closure:%s:%d}" 73 string(%d) "{closure:%s:%d}" 83 string(%d) "{closure:%s:%d}" 87 string(%d) "{closure:%s:%d}"
|
/php-src/Zend/tests/type_declarations/union_types/ |
H A D | type_checking_strict.phpt | 36 $msg = str_replace('{closure}(): Argument #1 ($arg)', 'Argument ...', $msg); 69 "42" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 70 "42.0" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 71 "42x" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 72 "x" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 73 "" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 74 true => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, true given 75 false => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, false given 76 null => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, null given 77 [] => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, array given [all …]
|
H A D | type_checking_weak.phpt | 34 $msg = str_replace('{closure}(): Argument #1 ($arg)', 'Argument ...', $msg); 69 "42x" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 70 "x" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 71 "" => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, string given 74 null => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, null given 75 [] => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, array given 76 new stdClass => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|float, stdClass given 122 null => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|bool, null given 123 [] => {closure:%s:%d}(): Argument #1 ($arg) must be of type int|bool, array given 154 null => {closure:%s:%d}(): Argument #1 ($arg) must be of type string|bool, null given [all …]
|
/php-src/Zend/tests/closures/ |
H A D | closure_065.phpt | 2 The closure name includes the source location (2) 82 string(49) "{closure:NameSpaceName\ClassName::methodName():6}" 83 string(79) "{closure:{closure:{closure:NameSpaceName\ClassName::nestedClosure():12}:13}:14}" 84 string(42) "{closure:NameSpaceName\function_name():27}" 85 string(36) "{closure:ClassName::methodName():36}" 86 string(65) "{closure:{closure:{closure:ClassName::nestedClosure():42}:43}:44}" 87 string(28) "{closure:function_name():57}" 88 string(%d) "{closure:%sclosure_%d.php:72}"
|
H A D | closure_032.phpt | 6 function test(closure $a) { 23 [function] => {closure:%s:%d} 32 #0 %s(%d): {closure:%s:%d}(23) 39 [function] => {closure:%s:%d} 56 [name] => {closure:%s:%d} 71 #0 %s(%d): {closure:%s:%d}(23)
|
H A D | closure_064.phpt | 2 The closure name includes the source location 26 #1 %s(12): {closure:%s:11}() 27 #2 %s(4): {closure:%s:12}() 28 #3 %s(15): {closure:%s:3}() 29 #4 [internal function]: {closure:%s:15}(1)
|
H A D | closure_060.phpt | 16 $closure = A::get(); 17 $closure(); // init rt_cache 18 $closure->call(new class(){}, null); 19 $closure();
|
/php-src/Zend/tests/type_declarations/ |
H A D | scalar_strict_64bit.phpt | 63 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 66 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on li… 69 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on li… 72 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 75 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 78 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 84 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on li… 87 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on lin… 90 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on li… 93 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on lin… [all …]
|
H A D | scalar_strict.phpt | 63 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 66 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on li… 69 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on li… 72 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 75 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 78 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 84 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on li… 87 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on lin… 90 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on li… 93 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on lin… [all …]
|
H A D | scalar_strict_basic.phpt | 60 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on li… 63 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on l… 66 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on lin… 69 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on li… 72 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on lin… 75 *** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on li… 95 *** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on l… 101 *** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on l… 115 *** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on l… 144 *** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on lin… [all …]
|
/php-src/Zend/tests/ |
H A D | bug54358.phpt | 12 $closure = function() use ($asserter, &$function) { 16 $closure(); 20 $closure = function() use ($asserter, $function) { 24 $closure(); 28 $closure = function() use ($asserter, $function) { 32 $closure();
|
H A D | bug62991.phpt | 2 Bug #62991 (Segfault with generator and closure) 8 $closure = function() use ( $array ) { 12 return $closure(); 17 $closure = function() use ( $array ) { 21 return $closure; // if you return the $closure and call it outside this function it works.
|
H A D | bug79778.phpt | 2 Bug #79778: Assertion failure if dumping closure with unresolved static variable 30 string(%d) "{closure:%s:%d}" 43 [name] => {closure:%s:%d} 55 string(%d) "{closure:%s:%d}" 68 [name] => {closure:%s:%d} 79 string(%d) "{closure:%s:%d}" 92 [name] => {closure:%s:%d}
|
H A D | bug52193.phpt | 2 Bug #52193 (converting closure to array yields empty array) 40 string(%d) "{closure:%s:%d}" 52 string(%d) "{closure:%s:%d}" 64 string(%d) "{closure:%s:%d}" 76 string(%d) "{closure:%s:%d}" 88 string(%d) "{closure:%s:%d}" 101 string(%d) "{closure:%s:%d}" 112 string(%d) "{closure:%s:%d}"
|
/php-src/ext/opcache/tests/opt/ |
H A D | inference_012.phpt | 10 $closure = function() {return "string";}; 11 unset($x['b'][$closure()]['d']); 13 $arr = ['a' => $closure(), 'b' => [$closure() => []]]; 15 unset($x['b'][$closure()]['d']);
|
/php-src/ext/opcache/tests/jit/ |
H A D | assign_035.phpt | 17 $closure = function() { return "string"; }; 20 'a' => $closure(), 21 'b' => [$closure() => [],], 25 unset($x['b'][$closure()]['d']); 28 $x['a'] = $closure();
|