-
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 bug #81163 __sleep allowed to return non-array
- Loading branch information
Showing
2 changed files
with
40 additions
and
16 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,21 @@ | ||
--TEST-- | ||
Test __sleep returns non-array | ||
--FILE-- | ||
<?php | ||
class foo | ||
{ | ||
private $private = 'private'; | ||
} | ||
|
||
class bar extends foo | ||
{ | ||
public function __sleep() | ||
{ | ||
return (new bar()); | ||
} | ||
} | ||
|
||
serialize(new bar()); | ||
?> | ||
--EXPECTF-- | ||
Warning: serialize(): bar::__sleep() should return an array only containing the names of instance-variables to serialize in %s on line %d |
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