Skip to content

Commit

Permalink
ext/spl: Follow-up on GH-9704 (#15295)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Düsterhus <[email protected]>
  • Loading branch information
Girgias and TimWolla authored Aug 8, 2024
1 parent bb2836e commit c8b45aa
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ PHP NEWS
. INI settings session.sid_length and session.sid_bits_per_character are now
deprecated. (timwolla)

- SPL:
. The SplFixedArray::__wakeup() method has been deprecated as it implements
__serialize() and __unserialize() which need to be overwritten instead.
(TysonAndre)

- Standard:
. Unserializing the uppercase 'S' tag is now deprecated. (timwolla)

Expand Down
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ PHP 8.4 UPGRADE NOTES
hexadecimal session IDs and stop changing these two INI settings.
RFC: https://wiki.php.net/rfc/deprecations_php_8_4

- SPL:
. The SplFixedArray::__wakeup() method has been deprecated as it implements
__serialize() and __unserialize() which need to be overwritten instead.

- Standard:
. Calling stream_context_set_option() with 2 arguments is deprecated.
Use stream_context_set_options() instead.
Expand Down
1 change: 1 addition & 0 deletions ext/spl/spl_fixedarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "php.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"
#include "zend_attributes.h"

#include "spl_fixedarray_arginfo.h"
#include "spl_fixedarray.h"
Expand Down
6 changes: 2 additions & 4 deletions ext/spl/spl_fixedarray.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ class SplFixedArray implements IteratorAggregate, ArrayAccess, Countable, JsonSe
{
public function __construct(int $size = 0) {}

/**
* @tentative-return-type
* @deprecated
*/
/** @tentative-return-type */
#[\Deprecated(since: '8.4', message: 'this method is obsolete, as serialization hooks are provided by __unserialize() and __serialize()')]
public function __wakeup(): void {}

public function __serialize(): array {}
Expand Down
15 changes: 14 additions & 1 deletion ext/spl/spl_fixedarray_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c8b45aa

Please sign in to comment.