mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.5'
This commit is contained in:
@@ -13,6 +13,4 @@ enum Foo {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Fatal error: Enum Foo cannot include magic method __sleep in %s on line %d
|
||||
|
||||
@@ -13,6 +13,4 @@ enum Foo {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Fatal error: Enum Foo cannot include magic method __wakeup in %s on line %d
|
||||
|
||||
@@ -20,4 +20,3 @@ $obj = $reflector->newLazyProxy(function() {
|
||||
serialize($obj);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
@@ -36,7 +36,6 @@ try {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
Init on serialize and successful initialization
|
||||
string(27) "O:1:"C":1:{s:4:"%0C%0b";i:1;}"
|
||||
Init on serialize and failed initialization
|
||||
|
||||
@@ -37,7 +37,6 @@ $obj = $reflector->newLazyProxy(function ($obj) {
|
||||
test('Proxy', $obj);
|
||||
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
# Ghost:
|
||||
string(11) "initializer"
|
||||
string(24) "O:1:"C":1:{s:1:"a";i:1;}"
|
||||
|
||||
@@ -35,7 +35,6 @@ $obj = $reflector->newLazyProxy(function ($obj) {
|
||||
test('Proxy', $obj);
|
||||
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
# Ghost:
|
||||
string(12) "O:1:"C":0:{}"
|
||||
object(C)#%d (0) {
|
||||
|
||||
@@ -38,7 +38,6 @@ $obj = $reflector->newLazyProxy(function ($obj) {
|
||||
test('Proxy', $obj);
|
||||
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
# Ghost:
|
||||
string(11) "initializer"
|
||||
int(1)
|
||||
|
||||
@@ -24,6 +24,5 @@ $db_str = serialize($db);
|
||||
$db2 = unserialize($db_str);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
ok
|
||||
|
||||
@@ -9375,15 +9375,6 @@ static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel)
|
||||
ce->ce_flags |= ZEND_ACC_TOP_LEVEL;
|
||||
}
|
||||
|
||||
if (ce->__serialize == NULL && zend_hash_exists(&ce->function_table, ZSTR_KNOWN(ZEND_STR_SLEEP))) {
|
||||
zend_error(E_DEPRECATED, "The __sleep() serialization magic method has been deprecated."
|
||||
" Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)");
|
||||
}
|
||||
if (ce->__unserialize == NULL && zend_hash_exists(&ce->function_table, ZSTR_KNOWN(ZEND_STR_WAKEUP))) {
|
||||
zend_error(E_DEPRECATED, "The __wakeup() serialization magic method has been deprecated."
|
||||
" Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary)");
|
||||
}
|
||||
|
||||
/* We currently don't early-bind classes that implement interfaces or use traits */
|
||||
if (!ce->num_interfaces && !ce->num_traits && !ce->num_hooked_prop_variance_checks
|
||||
#ifdef ZEND_OPCACHE_SHM_REATTACHMENT
|
||||
|
||||
@@ -22,8 +22,6 @@ try {
|
||||
var_dump( $foo );
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var2.php:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: DateTime->__unserialize(Array)
|
||||
|
||||
@@ -22,8 +22,6 @@ try {
|
||||
var_dump( $foo );
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var3.php:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: DateTime->__unserialize(Array)
|
||||
|
||||
@@ -80,9 +80,6 @@ echo "Serialized:\n-----------\n$serialized\n-----------\nRestored:\n-----------
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
=== __sleep and __wakeup ===
|
||||
string(144) "O:34:"SerializableDomDocumentSleepWakeup":1:{s:43:"%0SerializableDomDocumentSleepWakeup%0xmlData";s:39:"<?xml version="1.0"?>
|
||||
<tag>value</tag>
|
||||
|
||||
@@ -110,10 +110,6 @@ $db = MySQLPDOTest::factory();
|
||||
$db->exec('DROP TABLE IF EXISTS test_stmt_fetch_class');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
Creating an object, serializing it and writing it to DB...
|
||||
myclass::singleton(Creating object)
|
||||
|
||||
@@ -107,10 +107,6 @@ $db = MySQLPDOTest::factory();
|
||||
$db->exec('DROP TABLE IF EXISTS test_stmt_fetch_serialize');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
Creating an object, serializing it and writing it to DB...
|
||||
myclass::singleton(Creating object)
|
||||
|
||||
@@ -110,10 +110,6 @@ $db = MySQLPDOTest::factory();
|
||||
$db->exec('DROP TABLE IF EXISTS test_stmt_fetchserialize_fetch_class');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
Creating an object, serializing it and writing it to DB...
|
||||
myclass::singleton(Creating object)
|
||||
|
||||
@@ -58,7 +58,6 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
|
||||
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php.copy.php');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
Reading file contents through stream wrapper
|
||||
string(18) "contents of file a"
|
||||
Original metadata
|
||||
|
||||
@@ -68,9 +68,6 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
|
||||
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php.copy.php');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
In __destruct 1
|
||||
string(1) "a"
|
||||
Loading metadata for 'a' without allowed_classes
|
||||
|
||||
@@ -34,7 +34,6 @@ function ptr2str($ptr)
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
|
||||
@@ -34,7 +34,6 @@ function ptr2str($ptr)
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
|
||||
@@ -78,9 +78,6 @@ $a = unserialize($data);
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
N;
|
||||
b:1;
|
||||
b:0;
|
||||
|
||||
@@ -128,14 +128,6 @@ echo "===AutoNA===\n";
|
||||
var_dump(unserialize('O:22:"autoload_not_available":0:{}'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
===O1===
|
||||
TestOld::__sleep()
|
||||
|
||||
@@ -38,8 +38,7 @@ var_dump($s = serialize($obj));
|
||||
var_dump(unserialize($s));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
string(126) "O:6:"Wakeup":1:{s:4:"data";a:1:{i:0;O:11:"Unserialize":1:{i:0;O:6:"Wakeup":1:{s:4:"data";a:1:{i:0;O:11:"Unserialize":0:{}}}}}}"
|
||||
__unserialize() called
|
||||
array(0) {
|
||||
|
||||
@@ -26,7 +26,6 @@ var_dump($t);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
__sleep called
|
||||
|
||||
Warning: serialize(): "b" returned as member variable from __sleep() but does not exist in %s on line %d
|
||||
|
||||
@@ -28,8 +28,7 @@ echo $s . "\n";
|
||||
|
||||
var_dump(unserialize($s));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["one"]=>
|
||||
string(3) "ABC"
|
||||
|
||||
@@ -21,8 +21,4 @@ serialize($obj);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): "parents" returned as member variable from __sleep() but does not exist in %s on line %d
|
||||
|
||||
@@ -20,6 +20,5 @@ try {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
string(6) "Failed"
|
||||
|
||||
@@ -26,7 +26,5 @@ try {
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
string(6) "Failed"
|
||||
|
||||
@@ -73,10 +73,7 @@ function check(myObjC $obj) {
|
||||
return 'successful';
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
SCRIPT START
|
||||
check successful
|
||||
start serialize/unserialize
|
||||
|
||||
@@ -25,8 +25,7 @@ for($i = 0; $i < 5; $i++) {
|
||||
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
object(evilClass)#1 (0) {
|
||||
|
||||
@@ -34,10 +34,7 @@ echo $si . "\n";
|
||||
var_dump(unserialize($ss));
|
||||
var_dump(unserialize($si));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
O:10:"testString":1:{s:1:"a";b:1;}
|
||||
O:11:"testInteger":1:{s:1:"a";b:1;}
|
||||
object(testString)#3 (1) {
|
||||
|
||||
@@ -23,7 +23,6 @@ var_dump($data);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
int(1)
|
||||
array(2) {
|
||||
[0]=>
|
||||
|
||||
@@ -48,9 +48,7 @@ function ptr2str($ptr)
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: obj implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
array(2) {
|
||||
[0]=>
|
||||
object(obj2)#%d (1) {
|
||||
|
||||
@@ -26,8 +26,7 @@ var_dump($x);
|
||||
var_dump($obj);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
|
||||
@@ -18,8 +18,6 @@ var_dump($s);
|
||||
var_dump(unserialize($s));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): "b" is returned from __sleep() multiple times in %s on line %d
|
||||
string(39) "O:1:"A":1:{s:1:"b";O:8:"stdClass":0:{}}"
|
||||
object(A)#%d (1) {
|
||||
|
||||
@@ -49,10 +49,6 @@ try {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: unserialize(): Error at offset 17 of 24 bytes in %s on line %d
|
||||
bool(false)
|
||||
|
||||
|
||||
@@ -15,5 +15,4 @@ var_dump(unserialize($poc));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
%s(73588229205)
|
||||
|
||||
@@ -12,6 +12,5 @@ class a {
|
||||
$s = 'a:1:{i:0;O:1:"a":1:{s:1:"a";R:2;}}';
|
||||
var_dump(serialize(unserialize($s)));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
string(22) "a:1:{i:0;O:1:"a":0:{}}"
|
||||
|
||||
@@ -24,10 +24,6 @@ serialize(new B());
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): A::__sleep() should return an array only containing the names of instance-variables to serialize in %s on line %d
|
||||
|
||||
Warning: serialize(): B::__sleep() should return an array only containing the names of instance-variables to serialize in %s on line %d
|
||||
|
||||
@@ -18,6 +18,4 @@ class bar extends foo
|
||||
serialize(new bar());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): bar::__sleep() should return an array only containing the names of instance-variables to serialize in %s on line %d
|
||||
|
||||
@@ -42,7 +42,6 @@ printf("serialized temp : %s\n", $stc);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
serialized original: O:1:"B":1:{s:1:"a";O:1:"A":1:{s:1:"x";r:1;}}
|
||||
serialized temp : O:1:"B":1:{s:1:"a";O:1:"A":1:{s:1:"x";r:1;}}
|
||||
serialized original: O:1:"C":1:{s:1:"b";O:1:"B":1:{s:1:"a";O:1:"A":1:{s:1:"x";r:2;}}}
|
||||
|
||||
@@ -27,5 +27,4 @@ echo serialize($data), "\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
a:2:{i:0;O:4:"Item":2:{s:8:"children";a:1:{i:0;O:4:"Item":2:{s:8:"children";a:0:{}s:6:"parent";O:4:"Item":2:{s:8:"children";a:1:{i:0;r:4;}s:6:"parent";N;}}}s:6:"parent";N;}i:1;r:6;}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
__sleep() deprecation promoted to exception
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
|
||||
throw new ErrorException($errstr);
|
||||
});
|
||||
|
||||
try {
|
||||
eval(<<<'CODE'
|
||||
class Test {
|
||||
public function __sleep() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
CODE);
|
||||
} catch (Throwable $e) {
|
||||
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ErrorException: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function __sleep() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
___sleep() deprecation promoted to exception
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
|
||||
throw new ErrorException($errstr);
|
||||
});
|
||||
|
||||
try {
|
||||
require __DIR__ . '/sleep_deprecation_promoted_exception2.inc';
|
||||
} catch (Throwable $e) {
|
||||
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ErrorException: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)
|
||||
@@ -14,6 +14,5 @@ class Test {
|
||||
var_dump(serialize(new Test));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
string(28) "O:4:"Test":1:{s:1:"x";i:42;}"
|
||||
|
||||
@@ -12,7 +12,5 @@ $s = serialize(new Test);
|
||||
var_dump(str_replace("\0", '\0', $s));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): "priv" is returned from __sleep() multiple times in %s on line %d
|
||||
string(37) "O:4:"Test":1:{s:10:"\0Test\0priv";N;}"
|
||||
|
||||
@@ -21,8 +21,6 @@ var_dump(serialize(new Test));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): "pub" returned as member variable from __sleep() but does not exist in %s on line %d
|
||||
|
||||
Warning: serialize(): "prot" returned as member variable from __sleep() but does not exist in %s on line %d
|
||||
|
||||
@@ -32,8 +32,7 @@ var_dump(unserialize(serialize($t)) == $t);
|
||||
|
||||
var_dump($t);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
string(15) "O:4:"Test":0:{}"
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
__wakeup() deprecation promoted to exception
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
|
||||
throw new ErrorException($errstr);
|
||||
});
|
||||
|
||||
try {
|
||||
eval(<<<'CODE'
|
||||
class Test {
|
||||
public function __wakeup() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
CODE);
|
||||
} catch (Throwable $e) {
|
||||
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ErrorException: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary)
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function __wakeup() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
__wakeup() deprecation promoted to exception
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
|
||||
throw new ErrorException($errstr);
|
||||
});
|
||||
|
||||
try {
|
||||
require __DIR__ . '/wakeup_deprecation_promoted_exception2.inc';
|
||||
} catch (Throwable $e) {
|
||||
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ErrorException: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary)
|
||||
|
||||
@@ -14,7 +14,5 @@ unserialize($poc);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: unserialize(): Error at offset 50 of 50 bytes in %s on line %d
|
||||
DONE
|
||||
|
||||
@@ -18,7 +18,5 @@ $data = serialize($foo);
|
||||
var_dump(str_replace("\0", '\0', $data));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d
|
||||
string(114) "O:3:"foo":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}"
|
||||
|
||||
@@ -19,6 +19,5 @@ class bar extends foo
|
||||
|
||||
var_dump(str_replace("\0", '\0', serialize(new bar())));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
--EXPECT--
|
||||
string(114) "O:3:"bar":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}"
|
||||
|
||||
Reference in New Issue
Block a user