-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-8.4: Free the trampoline when deprecation on materializing `__callStatic()` of trait throws (#17729)
- Loading branch information
Showing
2 changed files
with
34 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--TEST-- | ||
GH-17728: Assertion failure when calling static method of trait with `__callStatic()` with throwing error handler | ||
--FILE-- | ||
<?php | ||
|
||
set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline) { | ||
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); | ||
}); | ||
|
||
trait Foo { | ||
public static function __callStatic($method, $args) { | ||
var_dump($method); | ||
} | ||
} | ||
|
||
try { | ||
Foo::bar(); | ||
} catch (ErrorException $e) { | ||
echo $e->getMessage(), PHP_EOL; | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
Calling static trait method Foo::bar is deprecated, it should only be called on a class using the trait |
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