-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix first-class callable internal error
- Loading branch information
1 parent
3a3c69e
commit 3f75d8a
Showing
6 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php // lint >= 8.1 | ||
|
||
namespace Bug7135; | ||
|
||
class HelloWorld | ||
{ | ||
private \Closure $closure; | ||
public function sayHello(callable $callable): void | ||
{ | ||
$this->closure = $callable(...); | ||
} | ||
public function sayHello2(callable $callable): void | ||
{ | ||
$this->closure = $this->sayHello(...); | ||
} | ||
public function sayHello3(callable $callable): void | ||
{ | ||
$this->closure = strlen(...); | ||
} | ||
public function sayHello4(callable $callable): void | ||
{ | ||
$this->closure = new HelloWorld(...); | ||
} | ||
public function sayHello5(callable $callable): void | ||
{ | ||
$this->closure = self::doFoo(...); | ||
} | ||
|
||
public static function doFoo(): void | ||
{ | ||
|
||
} | ||
|
||
public function getClosure(): \Closure | ||
{ | ||
return $this->closure; | ||
} | ||
} |