Bug #79526 [NEW]: `__sleep` error message wrong
| From: | carusogabriel@php.net | Date: | Mon, 27 Apr 2020 00:20:02 +0000 |
| Subject: | Bug #79526 [NEW]: `__sleep` error message wrong | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-226787@lists.php.net to get a copy of this message | ||
From: carusogabriel
Operating system: *
PHP version: 7.3.17
Package: *Compile Issues
Bug Type: Bug
Bug description:
__sleep error message wrong
Description:
------------
Although we have a new Serialization mechanism
(https://wiki.php.net/rfc/custom_object_serialization), this bug still
persists on PHP 7,3 as:
When returning something different from an array when calling
serialize() on a class that has the method __sleep implemented, the
error message says that a serialize(): __sleep should return an array,
instead of Foo::__sleep().
Test script:
---------------
<?php
class Foo
{
public function __sleep()
{
return 1;
}
}
serialize(new Foo());
Expected result:
----------------
Notice: Foo::__sleep() should return an array only containing the names
of instance-variables to serialize in %d on line %d
Actual result:
--------------
Notice: serialize(): __sleep should return an array only containing the
names of instance-variables to serialize in %d on line %d
--
Edit bug report at https://bugs.php.net/bug.php?id=79526&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79526&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79526&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79526&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79526&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79526&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79526&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79526&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79526&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79526&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79526&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79526&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79526&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79526&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79526&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79526&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79526&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79526&r=mysqlcfg