Bug #75958 [Asn->Csd]: bool return on some SPL methods, not void

From: Date: Wed, 25 Mar 2020 14:05:47 +0000
Subject: Bug #75958 [Asn->Csd]: bool return on some SPL methods, not void
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226260@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75958&edit=1

 ID:                 75958
 Updated by:         kocsismate@php.net
 Reported by:        oeildanslabouche at gmail dot com
 Summary:            bool return on some SPL methods, not void
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            SPL related
 Operating System:   windows
 PHP Version:        Next major version
 Assigned To:        carusogabriel
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of kocsismate@woohoolabs.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=782f7e2ad864693919b9f9efbb4d64bbae17cdc5
Log: Fix #75958 Return void instead of true


Previous Comments:
------------------------------------------------------------------------
[2018-08-12 00:14:45] carusogabriel@php.net

Also Locale::setDefault from https://bugs.php.net/55173

------------------------------------------------------------------------
[2018-08-11 21:38:24] cmb@php.net

Adding array_walk()[1] to this list, even though it is not an SPL
method.

[1] <https://bugs.php.net/76668>

------------------------------------------------------------------------
[2018-07-23 02:32:02] carusogabriel@php.net

We're only going to change it in the next major version of PHP, as this, unfortunately, is a
BC.

Ref: https://github.com/php/php-src/pull/3162

------------------------------------------------------------------------
[2018-02-14 09:59:57] requinix@php.net

Just went through the SPL code...

Always RETURN_TRUE, docs say void:
- SplHelp::insert
- SplPriorityQueue::insert
- SplHeap::recoverFromCorruption
- SplDoublyLinkedList::push
- SplDoublyLinkedList::unshift

Always RETURN_TRUE, docs say bool:
- SplFixedArray::setSize

Always returning true isn't helpful. Maybe it would be better to change the code so they are
actually void?

------------------------------------------------------------------------
[2018-02-14 09:38:03] oeildanslabouche at gmail dot com

Description:
------------
The doc says push() return void, but it's a boolean indeed.

Test script:
---------------
$test = new \SplStack();
var_dump( $test->push(1));



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75958&edit=1


Thread (1 message)

  • kocsismate@php.net
  • Unknown Message
    • kocsismate@php.net
« previous php.bugs (#226260) next »