-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-8140: Wrong first class callable by name optimization
When optimizing by name function calls, we must not replace `CALLABLE_CONVERT` opcodes, but have to keep them. Closes GH-8144.
- Loading branch information
Showing
4 changed files
with
37 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
GH-8140 (Wrong first class callable by name optimization) | ||
--FILE-- | ||
<?php | ||
namespace Test; | ||
|
||
function greeter(string $name) { | ||
echo "Hello, ${name}!"; | ||
} | ||
|
||
$mycallable = greeter(...); | ||
|
||
$mycallable("world"); | ||
?> | ||
--EXPECT-- | ||
Hello, world! |
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,14 @@ | ||
--TEST-- | ||
GH-8140 (Wrong first class callable by name optimization) | ||
--FILE-- | ||
<?php | ||
$mycallable = greeter(...); | ||
|
||
function greeter(string $name) { | ||
echo "Hello, ${name}!"; | ||
} | ||
|
||
$mycallable("world"); | ||
?> | ||
--EXPECT-- | ||
Hello, world! |