Skip to content

Commit

Permalink
JsonBomb: Don't directly type hint `mixed'
Browse files Browse the repository at this point in the history
Under PHP 7.x this causes an error:

    Return value of JsonBomb::jsonSerialize() must be an instance of
    mixed, resource returned

Because `mixed' is not recognized as an actual type hint before PHP 8.
  • Loading branch information
ancarda committed Feb 26, 2022
1 parent c2fcd90 commit e308057
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Json/JsonBomb.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
*/
final class JsonBomb implements JsonSerializable
{
public function jsonSerialize(): mixed
/**
* @return mixed
*/
public function jsonSerialize()
{
return fopen('php://memory', 'w');
}
Expand Down

0 comments on commit e308057

Please sign in to comment.