Home
last modified time | relevance | path

Searched refs:fn (Results 1 – 25 of 268) sorted by relevance

1234567891011

/php-src/Zend/tests/arrow_functions/
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 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) {
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 D003.phpt8 $fn = fn() => $$var;
9 var_dump($fn());
12 $fn = fn() => ${5};
13 var_dump($fn());
/php-src/Zend/tests/first_class_callable/
H A Dfirst_class_callable_dynamic.phpt17 $fn = $name(...);
18 var_dump($fn('x'));
21 $fn = $name(...);
22 var_dump($fn(2));
25 $fn = $name(...);
26 var_dump($fn(3));
30 $fn = $name1::$name2(...);
31 var_dump($fn(4));
34 $fn = (new A)->$name2(...);
35 var_dump($fn(5));
[all …]
/php-src/Zend/tests/closures/
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_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_from_callable_gc.phpt15 $fn = Closure::fromCallable([new Test, 'method2']);
16 $fn($fn);
17 unset($fn); // Still referenced from static var.
20 $fn = Closure::fromCallable([new Test, 'method']);
21 $fn2 = $fn; unset($fn2); // Add to root buffer.
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 …]
/php-src/ext/hash/tests/
H A Dhash_equals.phpt18 fn() => hash_equals("same", "same"),
20 fn() => hash_equals("short", "longer"),
22 fn() => hash_equals("", "notempty"),
23 fn() => hash_equals("notempty", ""),
24 fn() => hash_equals("", ""),
25 fn() => hash_equals(123, "NaN"),
26 fn() => hash_equals("NaN", 123),
27 fn() => hash_equals(123, 123),
28 fn() => hash_equals(null, ""),
29 fn() => hash_equals(null, 123),
[all …]
H A Dhash_hkdf_error.phpt25 fn() => hash_hkdf('foo', $ikm)
30 fn() => hash_hkdf('adler32', $ikm),
31 fn() => hash_hkdf('crc32', $ikm),
32 fn() => hash_hkdf('crc32b', $ikm),
33 fn() => hash_hkdf('fnv132', $ikm),
34 fn() => hash_hkdf('fnv1a32', $ikm),
35 fn() => hash_hkdf('fnv164', $ikm),
36 fn() => hash_hkdf('fnv1a64', $ikm),
37 fn() => hash_hkdf('joaat', $ikm)
42 fn() => hash_hkdf('sha1', ''),
[all …]
/php-src/Zend/tests/nullsafe_operator/
H A D013.phpt17 dump_error(fn() => strlen($foo?->foo()));
18 dump_error(fn() => is_null($foo?->foo()));
19 dump_error(fn() => is_bool($foo?->foo()));
20 dump_error(fn() => is_int($foo?->foo()));
21 dump_error(fn() => is_scalar($foo?->foo()));
22 dump_error(fn() => boolval($foo?->foo()));
23 dump_error(fn() => defined($foo?->foo()));
24 dump_error(fn() => chr($foo?->foo()));
25 dump_error(fn() => ord($foo?->foo()));
28 dump_error(fn() => get_class($foo?->foo()));
[all …]
H A D014.phpt6 function try_and_dump($fn) {
8 var_dump($fn());
23 try_and_dump(fn() => $null?->null() + $null?->null());
24 try_and_dump(fn() => $foo?->bar() + $null?->null());
25 try_and_dump(fn() => $null?->null() + $foo?->bar());
26 try_and_dump(fn() => $foo->bar() + $null?->null());
27 try_and_dump(fn() => $null?->null() + $foo->bar());
28 try_and_dump(fn() => $null?->null() + $null->null());
29 try_and_dump(fn() => $null->null() + $null?->null());
30 try_and_dump(fn() => ($foo?->bar() + $foo?->bar())?->baz());
/php-src/Zend/tests/namespaces/
H A Dnamespace_name_reserved_keywords.phpt6 namespace iter\fn {
12 namespace fn {
25 use iter\fn;
26 use function fn\test as test2;
28 fn\test();
35 iter\fn\test
36 fn\test
/php-src/Zend/tests/
H A Dclosure_bindTo_preserves_used_variables.phpt7 $fn = function() use($var) {
10 $fn();
11 $fn = $fn->bindTo(null, null);
12 $fn();
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";
/php-src/ext/standard/tests/file/
H A Dftruncate_bug76803.phpt6 $fn = __DIR__ . DIRECTORY_SEPARATOR . "test76803";
8 $f = fopen($fn, "w");
13 var_dump(addslashes(file_get_contents($fn)));
15 $f = fopen($fn, "w");
19 var_dump(addslashes(file_get_contents($fn)));
32 $fn = __DIR__ . DIRECTORY_SEPARATOR . "test76803";
33 unlink($fn);
H A Dbug53241.phpt12 $fn = __DIR__ . "/test.tmp";
13 @unlink($fn);
14 $fh = fopen($fn, 'xb');
21 $fn = __DIR__ . "/test.tmp";
22 @unlink($fn);
/php-src/ext/date/tests/
H A DDateTime_uninitialised_exceptions.phpt30 check(fn() => serialize($mdt));
35 check(fn() => $mdt->add($di));
36 check(fn() => $mdt->sub($di));
38 check(fn() => $mdt->getTimeZone());
41 check(fn() => date_offset_get($mdt));
42 check(fn() => $mdt->getOffset());
52 check(fn() => $mdt->getTimestamp());
53 check(fn() => date_diff($dt, $mdt));
56 check(fn() => $dt->diff($mdt));
57 check(fn() => $mdt->diff($dt));
[all …]
H A DDateTimeImmutable_uninitialised_exceptions.phpt30 check(fn() => serialize($mdti));
34 check(fn() => $mdti->add($di));
35 check(fn() => $mdti->sub($di));
37 check(fn() => $mdti->getTimeZone());
40 check(fn() => $mdti->getOffset());
46 check(fn() => $mdti->getTimestamp());
47 check(fn() => date_diff($dt, $mdti));
48 check(fn() => date_diff($mdti, $dt));
50 check(fn() => $dt->diff($mdti));
51 check(fn() => $mdti->diff($dt));
[all …]
/php-src/Zend/tests/attributes/
H A D011_inheritance.phpt25 print_r(array_map(fn ($a) => $a->getName(), $ref->getAttributes()));
26 print_r(array_map(fn ($a) => $a->getName(), $ref->getMethod('foo')->getAttributes()));
29 print_r(array_map(fn ($a) => $a->getName(), $ref->getAttributes()));
30 print_r(array_map(fn ($a) => $a->getName(), $ref->getMethod('foo')->getAttributes()));
33 print_r(array_map(fn ($a) => $a->getName(), $ref->getAttributes()));
34 print_r(array_map(fn ($a) => $a->getName(), $ref->getMethod('foo')->getAttributes()));
57 print_r(array_map(fn ($a) => $a->getName(), $ref->getProperty('a')->getAttributes()));
60 print_r(array_map(fn ($a) => $a->getName(), $ref->getProperty('a')->getAttributes()));
63 print_r(array_map(fn ($a) => $a->getName(), $ref->getProperty('a')->getAttributes()));
/php-src/ext/session/tests/user_session_module/
H A Dsave_handler_closures.inc5 foreach (array ('open', 'close', 'read', 'write', 'destroy', 'gc') as $fn) {
6 …${$fn.'_closure'} = function () use ($fn) { return call_user_func_array ($fn, func_get_args ()); };
/php-src/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-src/ext/standard/tests/file/windows_mb_path/
H A Dtest_cp874_to_utf8_1.phpt26 $fn = $prefix . DIRECTORY_SEPARATOR . $item;
28 var_dump($fn);
29 var_dump(touch($fn));
30 var_dump(file_exists($fn));
31 system("dir /b " . $fn);
H A Dtest_kartuli_utf8_3.phpt26 $fn = $prefix . DIRECTORY_SEPARATOR . $item;
28 var_dump($fn);
29 var_dump(touch($fn));
30 var_dump(file_exists($fn));
31 system("dir /b " . $fn);

Completed in 28 milliseconds

1234567891011