Home
last modified time | relevance | path

Searched refs:fn (Results 1 – 25 of 148) sorted by path

123456

/PHP-7.4/
H A DUPGRADING31 . "fn" is now a reserved keyword. In particular, it can no longer be used as a
210 $nums = array_map(fn($num) => $num * $factor, $nums);
/PHP-7.4/Zend/tests/arg_unpack/
H A Ddynamic.phpt6 $fn = function(...$args) {
10 $fn(...[]);
11 $fn(...[1, 2, 3]);
12 $fn(1, ...[2, 3], ...[], ...[4, 5]);
/PHP-7.4/Zend/tests/arrow_functions/
H A D001.phpt6 $foo = fn() => 1;
9 $foo = fn($x) => $x;
12 $foo = fn($x, $y) => $x + $y;
17 $foo = fn() => $var;
21 $foo = fn($var) => $var;
26 $foo = fn() => ++$var;
32 var_dump((fn() => fn() => $var)()());
33 var_dump((fn() => function() use($var) { return $var; })()());
H A D002.phpt8 var_dump((fn() => $b + $c)());
H A D003.phpt8 $fn = fn() => $$var;
9 var_dump($fn());
12 $fn = fn() => ${5};
13 var_dump($fn());
H A D004.phpt8 $fn = fn() => $GLOBALS['a'];
9 var_dump($fn());
H A D005.phpt9 $fn = fn() => 42;
13 $fn = fn() => $this;
14 var_dump($fn());
16 $fn = fn() => Test::method2();
17 $fn();
19 $fn = fn() => call_user_func('Test::method2');
20 $fn();
23 $fn = fn() => $$thisName;
24 var_dump($fn());
26 $fn = fn() => self::class;
[all …]
H A D006.phpt8 $id = fn&(&$x) => $x;
15 $int_fn = fn(int $x): int => $x;
23 $varargs = fn(?int... $args): array => $args;
H A D007.phpt7 assert((fn() => false)());
8 assert((fn&(int... $args): ?bool => $args[0])(false));
12 Warning: assert(): assert(fn() => false()) failed in %s on line %d
14 Warning: assert(): assert(fn&(int ...$args): ?bool => $args[0](false)) failed in %s on line %d
H A D008.phpt8 $fn = fn() => yield 123;
9 foreach ($fn() as $val) {
13 $fn = fn() => yield from [456, 789];
14 foreach ($fn() as $val) {
18 $fn = fn() => fn() => yield 987;
19 foreach ($fn()() as $val) {
/PHP-7.4/Zend/tests/
H A Dbug69568.phpt20 $fn = B::test();
21 echo $fn();
H A Dcall_to_deprecated_function_args.phpt24 $fn = 'ezmlm_hash';
25 $fn(new stdClass);
32 $fn = 'ezmlm_hash';
33 $ret = $fn(new stdClass);
H A Dclosure_061.phpt82 foreach ($tests as list($fn, $bindings)) {
83 if (is_array($fn)) {
84 $r = new ReflectionMethod($fn[0], $fn[1]);
85 $c = $r->getClosure(is_object($fn[0]) ? $fn[0] : null);
86 $fnStr = is_object($fn[0]) ? "(new " . get_class($fn[0]) . ")->$fn[1]" : "$fn[0]::$fn[1]";
88 $c = (new ReflectionFunction($fn))->getClosure();
89 $fnStr = $fn;
91 if ($fn instanceof Closure) {
H A Dclosure_062.phpt9 $fn = function() {
12 $fn->bindTo(null);
14 $fn = static function() {
17 $fn->bindTo(null);
19 $fn = function() {
22 $fn->bindTo(null);
27 $fn = function() {
30 $fn->bindTo(null);
35 $fn->bindTo(null);
37 $fn = function() {
[all …]
H A Dclosure_bug66622.phpt8 $fn = function() { return static::name(); };
9 echo static::name() . ' vs ' . $fn() . "\n";
12 $fn = static function() { return static::name(); };
13 echo static::name() . ' vs ' . $fn() . "\n";
16 $fn = function() { return static::name(); };
17 echo static::name() . ' vs ' . $fn() . "\n";
H A Dclosure_use_auto_global.phpt7 $fn = function() use($GLOBALS) {
10 $fn();
H A Dclosure_use_parameter_name.phpt7 $fn = function ($a) use ($a) {
10 $fn(2);
H A Dclosure_use_variable_twice.phpt7 $fn = function() use ($a, &$a) {
10 $fn();
/PHP-7.4/Zend/tests/closures/
H A Dclosure_from_callable.inc13 function test($fn)
19 $output = $fn($input);
H A Dclosure_from_callable_basic.phpt10 echo $fn(" OK".PHP_EOL);
14 echo $fn(" OK".PHP_EOL);
18 echo $fn(" OK".PHP_EOL);
22 echo $fn(" OK".PHP_EOL);
26 echo $fn(" OK".PHP_EOL);
30 echo $fn(" OK".PHP_EOL);
34 echo $fn(" OK".PHP_EOL);
38 echo $fn(" OK".PHP_EOL);
42 echo $fn(" OK".PHP_EOL);
47 echo $fn(" OK".PHP_EOL);
[all …]
H A Dclosure_from_callable_error.phpt10 $fn = Closure::fromCallable(['Foo', 'privateInstanceFunc']);
23 $fn = Closure::fromCallable('Foo::privateInstanceFunc');
83 $fn = Closure::fromCallable('Foo::privateStaticFunction');
95 $fn = Closure::fromCallable('Foo::nonExistentFunction');
107 $fn = Closure::fromCallable(['NonExistentClass', 'foo']);
119 $fn = Closure::fromCallable('thisDoesNotExist');
133 $fn = $subFoo->closePrivateInvalid();
146 $fn = $subFoo->closePrivateStaticInvalid();
158 $fn = functionAccessProtected();
170 $fn = functionAccessPrivate();
[all …]
H A Dclosure_from_callable_non_static_statically.phpt12 $fn = Closure::fromCallable(['A', 'method']);
13 $fn();
H A Dclosure_from_callable_rebinding.phpt15 $fn = Closure::fromCallable([new A, 'method']);
16 $fn->call(new B);
H A Dclosure_from_callable_reflection.phpt15 $fn = function (Bar $bar, int $x, $none) {};
20 $fn,
/PHP-7.4/Zend/tests/grammar/
H A Dsemi_reserved_001.phpt59 function fn(){ echo __METHOD__, PHP_EOL; }
139 $obj->fn();
218 Obj::fn

Completed in 35 milliseconds

123456