diff --git a/NEWS b/NEWS index 773cdf31f2e65..b1e02edfbd2c8 100644 --- a/NEWS +++ b/NEWS @@ -61,6 +61,9 @@ PHP NEWS . Added SKF_AD_QUEUE for cbpf filters. (David Carlier) . Added socket_atmark if send/recv needs using MSG_OOB. (David Carlier) +- Standard: + . E_NOTICEs emitted by unserialized() have been promoted to E_WARNING. (timwolla) + - Streams: . Fixed bug #51056: blocking fread() will block even if data is available. (Jakub Zelenka) diff --git a/UPGRADING b/UPGRADING index c277381629eaf..16f2de9eff26b 100644 --- a/UPGRADING +++ b/UPGRADING @@ -47,6 +47,10 @@ PHP 8.3 UPGRADE NOTES "buffer_size" => int See GH-9336 +- Standard: + . E_NOTICEs emitted by unserialized() have been promoted to E_WARNING. + RFC: https://wiki.php.net/rfc/improve_unserialize_error_handling + ======================================== 6. New Functions ======================================== diff --git a/Zend/tests/bug70253.phpt b/Zend/tests/bug70253.phpt index 053e49d9021ab..e502492c6726f 100644 --- a/Zend/tests/bug70253.phpt +++ b/Zend/tests/bug70253.phpt @@ -5,4 +5,4 @@ Bug #70253 (segfault at _efree () in zend_alloc.c:1389) unserialize('a:2:{i:0;O:9:"000000000":10000000'); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 33 of 33 bytes in %s on line %d +Warning: unserialize(): Error at offset 33 of 33 bytes in %s on line %d diff --git a/Zend/tests/enum/unserialize-const.phpt b/Zend/tests/enum/unserialize-const.phpt index 0731a68dccf59..c1e478e8d6e38 100644 --- a/Zend/tests/enum/unserialize-const.phpt +++ b/Zend/tests/enum/unserialize-const.phpt @@ -14,5 +14,5 @@ var_dump(unserialize('E:7:"Foo:Baz";')); --EXPECTF-- Warning: unserialize(): Foo::Baz is not an enum case in %s on line %d -Notice: unserialize(): Error at offset 14 of 14 bytes in %s on line %d +Warning: unserialize(): Error at offset 14 of 14 bytes in %s on line %d bool(false) diff --git a/Zend/tests/enum/unserialize-missing-colon.phpt b/Zend/tests/enum/unserialize-missing-colon.phpt index 86cce32df4e3a..a74dd0d077cff 100644 --- a/Zend/tests/enum/unserialize-missing-colon.phpt +++ b/Zend/tests/enum/unserialize-missing-colon.phpt @@ -13,5 +13,5 @@ var_dump(unserialize('E:6:"FooBar";')); --EXPECTF-- Warning: unserialize(): Invalid enum name 'FooBar' (missing colon) in %s on line %d -Notice: unserialize(): Error at offset 0 of 13 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 13 bytes in %s on line %d bool(false) diff --git a/Zend/tests/enum/unserialize-non-enum.phpt b/Zend/tests/enum/unserialize-non-enum.phpt index 82f4ec93dbec7..7771cd03d26d8 100644 --- a/Zend/tests/enum/unserialize-non-enum.phpt +++ b/Zend/tests/enum/unserialize-non-enum.phpt @@ -11,5 +11,5 @@ var_dump(unserialize('E:7:"Foo:Bar";')); --EXPECTF-- Warning: unserialize(): Class 'Foo' is not an enum in %s on line %d -Notice: unserialize(): Error at offset 0 of 14 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 14 bytes in %s on line %d bool(false) diff --git a/Zend/tests/enum/unserialize-non-existent-case.phpt b/Zend/tests/enum/unserialize-non-existent-case.phpt index 2364db5b15361..32dfad6e6ef4a 100644 --- a/Zend/tests/enum/unserialize-non-existent-case.phpt +++ b/Zend/tests/enum/unserialize-non-existent-case.phpt @@ -13,5 +13,5 @@ var_dump(unserialize('E:7:"Foo:Baz";')); --EXPECTF-- Warning: unserialize(): Undefined constant Foo::Baz in %s on line %d -Notice: unserialize(): Error at offset 14 of 14 bytes in %s on line %d +Warning: unserialize(): Error at offset 14 of 14 bytes in %s on line %d bool(false) diff --git a/ext/gmp/tests/bug74670.phpt b/ext/gmp/tests/bug74670.phpt index 5f9de9330e591..517b09ce7f588 100644 --- a/ext/gmp/tests/bug74670.phpt +++ b/ext/gmp/tests/bug74670.phpt @@ -8,5 +8,5 @@ $str = 'C:3:"GMP":4:{s:6666666666:""}'; var_dump(unserialize($str)); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 13 of 29 bytes in %s on line %d +Warning: unserialize(): Error at offset 13 of 29 bytes in %s on line %d bool(false) diff --git a/ext/phar/tests/phar_metadata_write3.phpt b/ext/phar/tests/phar_metadata_write3.phpt index 8cd966a64843a..304ed65b46e9f 100644 --- a/ext/phar/tests/phar_metadata_write3.phpt +++ b/ext/phar/tests/phar_metadata_write3.phpt @@ -79,7 +79,7 @@ Calling getMetadata with too low max_depth Warning: Phar::getMetadata(): Maximum depth of 1 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %sphar_metadata_write3.php on line 39 -Notice: Phar::getMetadata(): Error at offset 34 of 59 bytes in %sphar_metadata_write3.php on line 39 +Warning: Phar::getMetadata(): Error at offset 34 of 59 bytes in %sphar_metadata_write3.php on line 39 bool(false) Calling getMetadata with some allowed classes In wakeup diff --git a/ext/session/tests/bug72562.phpt b/ext/session/tests/bug72562.phpt index 5a3b4f7a8968a..48682b7563750 100644 --- a/ext/session/tests/bug72562.phpt +++ b/ext/session/tests/bug72562.phpt @@ -40,7 +40,7 @@ function ptr2str($ptr) --EXPECTF-- Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s%ebug72562.php on line %d -Notice: unserialize(): Error at offset 0 of 1 bytes in %s%ebug72562.php on line %d +Warning: unserialize(): Error at offset 0 of 1 bytes in %s on line %d -Notice: unserialize(): Error at offset 4 of 4 bytes in %s%ebug72562.php on line %d +Warning: unserialize(): Error at offset 4 of 4 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt index 5c8ad636aeff6..333c09525883c 100644 --- a/ext/standard/tests/serialize/005.phpt +++ b/ext/standard/tests/serialize/005.phpt @@ -157,7 +157,7 @@ Deprecated: %s implements the Serializable interface, which is deprecated. Imple Warning: Erroneous data format for unserializing 'TestNANew' in %s005.php on line %d -Notice: unserialize(): Error at offset 19 of 20 bytes in %s005.php on line %d +Warning: unserialize(): Error at offset 19 of 20 bytes in %s on line %d bool(false) ===NANew2=== unserializer(TestNANew2) diff --git a/ext/standard/tests/serialize/__serialize_006.phpt b/ext/standard/tests/serialize/__serialize_006.phpt index f824787662b25..9fc6692302b03 100644 --- a/ext/standard/tests/serialize/__serialize_006.phpt +++ b/ext/standard/tests/serialize/__serialize_006.phpt @@ -11,7 +11,7 @@ var_dump(unserialize('O:4:"Test":1:{}')); ?> --EXPECTF-- -Notice: unserialize(): Unexpected end of serialized data in %s on line %d +Warning: unserialize(): Unexpected end of serialized data in %s on line %d -Notice: unserialize(): Error at offset 14 of 15 bytes in %s on line %d +Warning: unserialize(): Error at offset 14 of 15 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug25378.phpt b/ext/standard/tests/serialize/bug25378.phpt index ab8cd987e5e38..846ea111d7e05 100644 --- a/ext/standard/tests/serialize/bug25378.phpt +++ b/ext/standard/tests/serialize/bug25378.phpt @@ -17,41 +17,41 @@ var_dump(unserialize("s:3:\"123;")); var_dump(unserialize("s:0:\"123\";")); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 0 of 8 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 0 of 8 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 5 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 0 of 5 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 13 of 19 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 13 of 19 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 14 of 19 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 14 of 19 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 2 of 22 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 2 of 22 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 17 of 18 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 17 of 18 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 24 of 33 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 24 of 33 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 17 of 33 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 32 of 32 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 32 of 32 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 2 of 13 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 2 of 11 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 2 of 11 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 8 of 9 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 8 of 9 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 5 of 10 bytes in %sbug25378.php on line %d +Warning: unserialize(): Error at offset 5 of 10 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug68044.phpt b/ext/standard/tests/serialize/bug68044.phpt index dc6053c501d47..d14257816d01c 100644 --- a/ext/standard/tests/serialize/bug68044.phpt +++ b/ext/standard/tests/serialize/bug68044.phpt @@ -10,5 +10,5 @@ Warning: unserialize(): %s in %sbug68044.php on line %d Warning: Insufficient data for unserializing - %d required, 1 present in %s%ebug68044.php on line 2 -Notice: unserialize(): Error at offset 32 of 33 bytes in %s%ebug68044.php on line 2 +Warning: unserialize(): Error at offset 32 of 33 bytes in %s on line %d ===DONE== diff --git a/ext/standard/tests/serialize/bug68545.phpt b/ext/standard/tests/serialize/bug68545.phpt index 9c37ab7c4f3cc..cb22ee2fbe64e 100644 --- a/ext/standard/tests/serialize/bug68545.phpt +++ b/ext/standard/tests/serialize/bug68545.phpt @@ -5,5 +5,5 @@ Bug #68545 NULL pointer dereference in unserialize.c:var_push_dtor var_dump(unserialize('a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"b22";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";s:3:"bar";')); ?> --EXPECTF-- -Notice: unserialize(): Error at offset %d of %d bytes in %sbug68545.php on line %d +Warning: unserialize(): Error at offset 10 of 310 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug70213.phpt b/ext/standard/tests/serialize/bug70213.phpt index 7129fe45f6cdb..5e4b64a314a21 100644 --- a/ext/standard/tests/serialize/bug70213.phpt +++ b/ext/standard/tests/serialize/bug70213.phpt @@ -15,7 +15,7 @@ var_dump(unserialize('a:2:{i:0;i:42;i:1;O:4:"evil":0:{}}')); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 4 of 4 bytes in %s on line %d +Warning: unserialize(): Error at offset 4 of 4 bytes in %s on line %d bool(false) Warning: unserialize(): Function evil() hasn't defined the class it was called for in %s on line %d diff --git a/ext/standard/tests/serialize/bug70219.phpt b/ext/standard/tests/serialize/bug70219.phpt index 02686f2fc98f4..0b6c40934bb80 100644 --- a/ext/standard/tests/serialize/bug70219.phpt +++ b/ext/standard/tests/serialize/bug70219.phpt @@ -31,5 +31,5 @@ var_dump($data); --EXPECTF-- Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d -Notice: unserialize(): Error at offset 55 of 56 bytes in %s on line %d +Warning: unserialize(): Error at offset 55 of 56 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug70436.phpt b/ext/standard/tests/serialize/bug70436.phpt index 46b3db763230c..50a54b51201c6 100644 --- a/ext/standard/tests/serialize/bug70436.phpt +++ b/ext/standard/tests/serialize/bug70436.phpt @@ -48,8 +48,8 @@ DONE --EXPECTF-- 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 -Notice: unserialize(): Error at offset 0 of 3 bytes in %sbug70436.php on line %d +Warning: unserialize(): Error at offset 0 of 3 bytes in %s on line %d -Notice: unserialize(): Error at offset 93 of 94 bytes in %sbug70436.php on line %d +Warning: unserialize(): Error at offset 93 of 94 bytes in %s on line %d bool(false) DONE diff --git a/ext/standard/tests/serialize/bug71840.phpt b/ext/standard/tests/serialize/bug71840.phpt index 6cbf04bfb4a44..e98e88bad69e3 100644 --- a/ext/standard/tests/serialize/bug71840.phpt +++ b/ext/standard/tests/serialize/bug71840.phpt @@ -5,5 +5,5 @@ Bug #71840 (Unserialize accepts wrongly data) var_dump(unserialize('a:1:{s:0:""0a:0:{}}')); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 11 of 19 bytes in %sbug71840.php on line %d +Warning: unserialize(): Error at offset 11 of 19 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug71995.phpt b/ext/standard/tests/serialize/bug71995.phpt index bf62c7da1eea8..9d51ace750e13 100644 --- a/ext/standard/tests/serialize/bug71995.phpt +++ b/ext/standard/tests/serialize/bug71995.phpt @@ -18,7 +18,7 @@ var_dump($s); var_dump(unserialize($s)); ?> --EXPECTF-- -Notice: serialize(): "b" is returned from __sleep() multiple times 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) { ["b"]=> diff --git a/ext/standard/tests/serialize/bug72663.phpt b/ext/standard/tests/serialize/bug72663.phpt index 9c006d50d80ba..ce767973e97f1 100644 --- a/ext/standard/tests/serialize/bug72663.phpt +++ b/ext/standard/tests/serialize/bug72663.phpt @@ -49,10 +49,10 @@ try { ?> --EXPECTF-- -Notice: unserialize(): Error at offset 17 of 24 bytes in %s on line %d +Warning: unserialize(): Error at offset 17 of 24 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 25 of 32 bytes in %s on line %d +Warning: unserialize(): Error at offset 25 of 32 bytes in %s on line %d bool(false) Caught Caught diff --git a/ext/standard/tests/serialize/bug72663_2.phpt b/ext/standard/tests/serialize/bug72663_2.phpt index 4911465e50acf..61fc99e65d732 100644 --- a/ext/standard/tests/serialize/bug72663_2.phpt +++ b/ext/standard/tests/serialize/bug72663_2.phpt @@ -21,9 +21,9 @@ var_dump(unserialize($exploit)); --EXPECTF-- 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 -Notice: unserialize(): Unexpected end of serialized data in %s on line %d +Warning: unserialize(): Unexpected end of serialized data in %s on line %d -Notice: unserialize(): Error at offset 49 of 50 bytes in %s on line %d +Warning: unserialize(): Error at offset 49 of 50 bytes in %s on line %d -Notice: unserialize(): Error at offset 82 of 83 bytes in %s on line %d +Warning: unserialize(): Error at offset 82 of 83 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug72663_3.phpt b/ext/standard/tests/serialize/bug72663_3.phpt index e902024863011..275910021a03a 100644 --- a/ext/standard/tests/serialize/bug72663_3.phpt +++ b/ext/standard/tests/serialize/bug72663_3.phpt @@ -12,7 +12,7 @@ session_decode($sess); var_dump($_SESSION); ?> --EXPECTF-- -Notice: session_decode(): Unexpected end of serialized data in %s on line %d +Warning: session_decode(): Unexpected end of serialized data in %s on line %d Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d array(0) { diff --git a/ext/standard/tests/serialize/bug73052.phpt b/ext/standard/tests/serialize/bug73052.phpt index 63b484bf14d25..6c5f521e8cdb8 100644 --- a/ext/standard/tests/serialize/bug73052.phpt +++ b/ext/standard/tests/serialize/bug73052.phpt @@ -14,5 +14,5 @@ $poc = 'O:3:"obj":1:{'; var_dump(unserialize($poc)); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 13 of 13 bytes in %sbug73052.php on line %d +Warning: unserialize(): Error at offset 13 of 13 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug73341.phpt b/ext/standard/tests/serialize/bug73341.phpt index 2f38949c1ae8f..fc1d0271bbc06 100644 --- a/ext/standard/tests/serialize/bug73341.phpt +++ b/ext/standard/tests/serialize/bug73341.phpt @@ -20,5 +20,5 @@ unserialize($exploit); --EXPECTF-- Error at offset 6 of 7 bytes -Notice: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d +Warning: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d Error at offset 24 of 34 bytes diff --git a/ext/standard/tests/serialize/bug73825.phpt b/ext/standard/tests/serialize/bug73825.phpt index adbfca1bbb171..2c66e375bde10 100644 --- a/ext/standard/tests/serialize/bug73825.phpt +++ b/ext/standard/tests/serialize/bug73825.phpt @@ -8,5 +8,5 @@ var_dump($obj); --EXPECTF-- Warning: Bad unserialize data in %sbug73825.php on line %d -Notice: unserialize(): Error at offset 13 of 15 bytes in %sbug73825.php on line %d +Warning: unserialize(): Error at offset 13 of 15 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug74101.phpt b/ext/standard/tests/serialize/bug74101.phpt index 3eca747cb13cd..2a90cf29db28e 100644 --- a/ext/standard/tests/serialize/bug74101.phpt +++ b/ext/standard/tests/serialize/bug74101.phpt @@ -8,5 +8,5 @@ var_dump(unserialize($s)); --EXPECTF-- Warning: unserialize(): %s in %sbug74101.php on line %d -Notice: unserialize(): Error at offset 46 of 74 bytes in %sbug74101.php on line %d +Warning: unserialize(): Error at offset 46 of 74 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug74103.phpt b/ext/standard/tests/serialize/bug74103.phpt index c1e54651f1de8..18cff884a57ed 100644 --- a/ext/standard/tests/serialize/bug74103.phpt +++ b/ext/standard/tests/serialize/bug74103.phpt @@ -5,5 +5,5 @@ Bug #74103: heap-use-after-free when unserializing invalid array size var_dump(unserialize('a:7:{i:0;i:04;s:1:"a";i:2;i:9617006;i:4;s:1:"a";i:4;s:1:"a";R:5;s:1:"7";R:3;s:1:"a";R:5;;s:18;}}')); ?> --EXPECTF-- -Notice: unserialize(): Error at offset %d of %d bytes in %s on line %d +Warning: unserialize(): Error at offset 64 of 96 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug74111.phpt b/ext/standard/tests/serialize/bug74111.phpt index 62922bea55ae0..87c94423a2a27 100644 --- a/ext/standard/tests/serialize/bug74111.phpt +++ b/ext/standard/tests/serialize/bug74111.phpt @@ -6,5 +6,5 @@ $s = 'O:8:"stdClass":00000000'; var_dump(unserialize($s)); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 25 of 23 bytes in %s on line %d +Warning: unserialize(): Error at offset 25 of 23 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug74300.phpt b/ext/standard/tests/serialize/bug74300.phpt index 53c6e9a01f400..33a0ff0f0ea21 100644 --- a/ext/standard/tests/serialize/bug74300.phpt +++ b/ext/standard/tests/serialize/bug74300.phpt @@ -10,5 +10,5 @@ var_dump(unserialize('d:2e++2;')); --EXPECTF-- float(200) -Notice: unserialize(): Error at offset 0 of 8 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 8 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug74614.phpt b/ext/standard/tests/serialize/bug74614.phpt index efaaf885d226b..8864175c891f3 100644 --- a/ext/standard/tests/serialize/bug74614.phpt +++ b/ext/standard/tests/serialize/bug74614.phpt @@ -9,4 +9,4 @@ unserialize('a:3020000000000000000000000000000001:{i:0;a:0:{}i:1;i:2;i:2;i:3;i:3 --EXPECTF-- Warning: unserialize(): %s in %sbug74614.php on line %d -Notice: unserialize(): Error at offset %d of 113 bytes in %s on line %d +Warning: unserialize(): Error at offset 38 of 113 bytes in %s on line %d diff --git a/ext/standard/tests/serialize/bug75054.phpt b/ext/standard/tests/serialize/bug75054.phpt index 51f5692f445aa..b1339c7d604a4 100644 --- a/ext/standard/tests/serialize/bug75054.phpt +++ b/ext/standard/tests/serialize/bug75054.phpt @@ -8,5 +8,5 @@ $poc .= '000";R:2;s:4:"0000";d:0;s:4:"0000";a:9:{s:4:"0000";'; var_dump(unserialize($poc)); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 43 of 145 bytes in %s on line %d +Warning: unserialize(): Error at offset 43 of 145 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug81111.phpt b/ext/standard/tests/serialize/bug81111.phpt index dad07e96e5fd2..aa5002eaf704d 100644 --- a/ext/standard/tests/serialize/bug81111.phpt +++ b/ext/standard/tests/serialize/bug81111.phpt @@ -50,4 +50,4 @@ Serialization of 'class@anonymous' is not allowed Unserialization of 'MySplFileInfo' is not allowed Unserialization of 'MySplFileInfo' is not allowed -Notice: unserialize(): Error at offset 0 of %d bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of %d bytes in %s on line %d diff --git a/ext/standard/tests/serialize/invalid_signs_in_lengths.phpt b/ext/standard/tests/serialize/invalid_signs_in_lengths.phpt index 6288cfc52e53e..c1545503d8c4b 100644 --- a/ext/standard/tests/serialize/invalid_signs_in_lengths.phpt +++ b/ext/standard/tests/serialize/invalid_signs_in_lengths.phpt @@ -18,38 +18,38 @@ var_dump(unserialize('a:1:{i:0;R:-1;}')); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 0 of 9 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 9 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 9 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 9 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 7 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 7 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 7 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 7 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 20 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 20 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 20 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 20 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 24 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 24 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 0 of 24 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 24 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d +Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d +Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d +Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d +Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/max_depth.phpt b/ext/standard/tests/serialize/max_depth.phpt index 1767239637c0e..09418e5c61da0 100644 --- a/ext/standard/tests/serialize/max_depth.phpt +++ b/ext/standard/tests/serialize/max_depth.phpt @@ -115,28 +115,28 @@ bool(true) Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d -Notice: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d +Warning: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d bool(false) Object: bool(true) Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d -Notice: unserialize(): Error at offset 2834 of 2971 bytes in %s on line %d +Warning: unserialize(): Error at offset 2834 of 2971 bytes in %s on line %d bool(false) Ini setting: bool(true) Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d -Notice: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d +Warning: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d bool(false) Ini setting overridden: bool(true) Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d -Notice: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d +Warning: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d bool(false) 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 @@ -144,7 +144,7 @@ Nested unserialize combined depth limit: Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d -Notice: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d +Warning: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d bool(false) bool(true) bool(true) @@ -154,7 +154,7 @@ Nested unserialize overridden depth limit: Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d -Notice: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d +Warning: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d bool(false) bool(true) bool(true) diff --git a/ext/standard/tests/serialize/serialization_error_002.phpt b/ext/standard/tests/serialize/serialization_error_002.phpt index 45872355481f5..51a54d3513de5 100644 --- a/ext/standard/tests/serialize/serialization_error_002.phpt +++ b/ext/standard/tests/serialize/serialization_error_002.phpt @@ -32,7 +32,7 @@ echo "Done"; *** Testing unserialize() error/boolean distinction *** string(4) "b:0;" -Notice: unserialize(): Error at offset 0 of 27 bytes in %s on line %d +Warning: unserialize(): Error at offset 0 of 27 bytes in %s on line %d bool(false) bool(false) unserialize error and deserialized false are identical? 1 diff --git a/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt b/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt index ac0c835a45a92..eef5949abbe57 100644 --- a/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt +++ b/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt @@ -12,5 +12,5 @@ $s = serialize(new Test); var_dump(str_replace("\0", '\0', $s)); ?> --EXPECTF-- -Notice: serialize(): "priv" is returned from __sleep() multiple times 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;}" diff --git a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt index 7ee35e8b69182..0e41ee82a5f59 100644 --- a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt +++ b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt @@ -25,5 +25,5 @@ var_dump(unserialize($s)); --EXPECTF-- Cannot assign stdClass to property Test::$prop of type int -Notice: unserialize(): Error at offset 38 of 38 bytes in %s on line %d +Warning: unserialize(): Error at offset 38 of 38 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/unserialize_large.phpt b/ext/standard/tests/serialize/unserialize_large.phpt index 9726306a8c3ff..758e8629a974b 100644 --- a/ext/standard/tests/serialize/unserialize_large.phpt +++ b/ext/standard/tests/serialize/unserialize_large.phpt @@ -10,16 +10,16 @@ var_dump(unserialize("C:1:\"X\":1000000000:{}")); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 14 of 15 bytes in %s on line %d +Warning: unserialize(): Error at offset 14 of 15 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 2 of 20 bytes in %s on line %d +Warning: unserialize(): Error at offset 2 of 20 bytes in %s on line %d bool(false) -Notice: unserialize(): Error at offset 18 of 21 bytes in %s on line %d +Warning: unserialize(): Error at offset 18 of 21 bytes in %s on line %d bool(false) Warning: Insufficient data for unserializing - 1000000000 required, 1 present in %s on line %d -Notice: unserialize(): Error at offset 20 of 21 bytes in %s on line %d +Warning: unserialize(): Error at offset 20 of 21 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/unserialize_leak.phpt b/ext/standard/tests/serialize/unserialize_leak.phpt index 383bcfc07569f..bbc4bb6facaef 100644 --- a/ext/standard/tests/serialize/unserialize_leak.phpt +++ b/ext/standard/tests/serialize/unserialize_leak.phpt @@ -12,5 +12,5 @@ try { ?> --EXPECTF-- -Notice: SplObjectStorage::unserialize(): Unexpected end of serialized data in %s on line %d +Warning: SplObjectStorage::unserialize(): Unexpected end of serialized data in %s on line %d Error at offset 24 of 113 bytes diff --git a/ext/standard/tests/serialize/unserialize_mem_leak.phpt b/ext/standard/tests/serialize/unserialize_mem_leak.phpt index ad010df535921..3ddb74a273df5 100644 --- a/ext/standard/tests/serialize/unserialize_mem_leak.phpt +++ b/ext/standard/tests/serialize/unserialize_mem_leak.phpt @@ -15,5 +15,5 @@ foo(unserialize($str)); echo "okey"; ?> --EXPECTF-- -Notice: unserialize(): Error at offset %d of %d bytes in %sunserialize_mem_leak.php on line 9 +Warning: unserialize(): Error at offset 13 of 14 bytes in %s on line %d okey diff --git a/ext/standard/tests/serialize/unserialize_ref_to_overwritten_declared_prop.phpt b/ext/standard/tests/serialize/unserialize_ref_to_overwritten_declared_prop.phpt index c4c3c957d3ee8..610c296c2f575 100644 --- a/ext/standard/tests/serialize/unserialize_ref_to_overwritten_declared_prop.phpt +++ b/ext/standard/tests/serialize/unserialize_ref_to_overwritten_declared_prop.phpt @@ -8,5 +8,5 @@ STR; var_dump(unserialize($str)); ?> --EXPECTF-- -Notice: unserialize(): Error at offset 36 of 52 bytes in %s on line %d +Warning: unserialize(): Error at offset 36 of 52 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/bug72433.phpt b/ext/standard/tests/strings/bug72433.phpt index f311022500ecf..ecfc52a1b7f39 100644 --- a/ext/standard/tests/strings/bug72433.phpt +++ b/ext/standard/tests/strings/bug72433.phpt @@ -6,5 +6,5 @@ $serialized_payload = 'a:3:{i:0;r:1;i:1;r:1;i:2;C:11:"ArrayObject":19:{x:i:0;r:1 var_dump(unserialize($serialized_payload)); ?> --EXPECTF-- -Notice: unserialize(): Error at offset %d of %d bytes in %sbug72433.php on line 3 +Warning: unserialize(): Error at offset 13 of 69 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/bug72663.phpt b/ext/standard/tests/strings/bug72663.phpt index d85fb7db1b67e..b06c85f5a6301 100644 --- a/ext/standard/tests/strings/bug72663.phpt +++ b/ext/standard/tests/strings/bug72663.phpt @@ -21,10 +21,10 @@ DONE --EXPECTF-- 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 -Notice: unserialize(): Unexpected end of serialized data in %sbug72663.php on line %d +Warning: unserialize(): Unexpected end of serialized data in %s on line %d -Notice: unserialize(): Error at offset 49 of 50 bytes in %sbug72663.php on line %d +Warning: unserialize(): Error at offset 49 of 50 bytes in %s on line %d -Notice: unserialize(): Error at offset 82 of 83 bytes in %sbug72663.php on line %d +Warning: unserialize(): Error at offset 82 of 83 bytes in %s on line %d bool(false) DONE diff --git a/ext/standard/tests/strings/bug72663_2.phpt b/ext/standard/tests/strings/bug72663_2.phpt index b65578d46a79c..648f82e9f8c87 100644 --- a/ext/standard/tests/strings/bug72663_2.phpt +++ b/ext/standard/tests/strings/bug72663_2.phpt @@ -13,7 +13,7 @@ var_dump($_SESSION); ?> DONE --EXPECTF-- -Notice: session_decode(): Unexpected end of serialized data in %sbug72663_2.php on line %d +Warning: session_decode(): Unexpected end of serialized data in %s on line %d Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d array(0) { diff --git a/ext/standard/tests/strings/bug72663_3.phpt b/ext/standard/tests/strings/bug72663_3.phpt index d8be463887047..bcec2b182a1da 100644 --- a/ext/standard/tests/strings/bug72663_3.phpt +++ b/ext/standard/tests/strings/bug72663_3.phpt @@ -14,5 +14,5 @@ unserialize($poc); ?> DONE --EXPECTF-- -Notice: unserialize(): Error at offset 50 of 50 bytes in %sbug72663_3.php on line %d +Warning: unserialize(): Error at offset 50 of 50 bytes in %s on line %d DONE diff --git a/ext/standard/var.c b/ext/standard/var.c index 268c535a80242..7c6f79aba75ff 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -842,7 +842,7 @@ static int php_var_serialize_try_add_sleep_prop( } if (!zend_hash_add(ht, name, val)) { - php_error_docref(NULL, E_NOTICE, + php_error_docref(NULL, E_WARNING, "\"%s\" is returned from __sleep() multiple times", ZSTR_VAL(error_name)); return SUCCESS; } @@ -1399,7 +1399,7 @@ PHPAPI void php_unserialize_with_options(zval *return_value, const char *buf, co } if (!php_var_unserialize(retval, &p, p + buf_len, &var_hash)) { if (!EG(exception)) { - php_error_docref(NULL, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %zd bytes", + php_error_docref(NULL, E_WARNING, "Error at offset " ZEND_LONG_FMT " of %zd bytes", (zend_long)((char*)p - buf), buf_len); } if (BG(unserialize).level <= 1) { diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 7066393a25aa3..12b0ff47c803e 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -1402,7 +1402,7 @@ fail: "}" { /* this is the case where we have less data than planned */ - php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data"); + php_error_docref(NULL, E_WARNING, "Unexpected end of serialized data"); return 0; /* not sure if it should be 0 or 1 here? */ }