Skip to content

Commit 4c7f490

Browse files
committed
fix
1 parent 8d1dce7 commit 4c7f490

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5139,15 +5139,21 @@ private function processArgs(
51395139
$scopeToPass = $closureBindScope;
51405140
}
51415141

5142-
if ($parameter instanceof ExtendedParameterReflection) {
5142+
if (
5143+
$parameterType === null
5144+
|| $parameterType instanceof MixedType
5145+
|| $parameterType->isCallable()->no()
5146+
) {
5147+
$callCallbackImmediately = false;
5148+
} elseif ($parameter instanceof ExtendedParameterReflection) {
51435149
$parameterCallImmediately = $parameter->isImmediatelyInvokedCallable();
51445150
if ($parameterCallImmediately->maybe()) {
5145-
$callCallbackImmediately = $calleeReflection instanceof FunctionReflection && !$calleeReflection->isBuiltin();
5151+
$callCallbackImmediately = $calleeReflection instanceof FunctionReflection;
51465152
} else {
51475153
$callCallbackImmediately = $parameterCallImmediately->yes();
51485154
}
51495155
} else {
5150-
$callCallbackImmediately = $calleeReflection instanceof FunctionReflection && !$calleeReflection->isBuiltin();
5156+
$callCallbackImmediately = $calleeReflection instanceof FunctionReflection;
51515157
}
51525158

51535159
if ($arg->value instanceof Expr\Closure) {

stubs/core.stub

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,14 @@ function get_defined_constants(bool $categorize = false): array {}
327327
*/
328328
function getopt(string $short_options, array $long_options = [], &$rest_index = null) {}
329329

330+
/**
331+
* @param callable|int $handler
332+
* @param-later-invoked-callable $handler
333+
*/
334+
function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): bool {}
335+
336+
/**
337+
* @param-later-invoked-callable $callback
338+
* @return string|array|object|null
339+
*/
340+
function set_error_handler(?callable $callback, int $error_levels = E_ALL) {}

0 commit comments

Comments
 (0)