Bug #75958 [Com]: bool return on some SPL methods, not void

From: Date: Sun, 12 Aug 2018 00:14:45 +0000
Subject: Bug #75958 [Com]: bool return on some SPL methods, not void
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216728@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 Comment by: carusogabriel@php.net Reported by: oeildanslabouche at gmail dot com Summary: bool return on some SPL methods, not void Status: Assigned Type: Bug Package: SPL related Operating System: windows PHP Version: 7.1.14 Assigned To: carusogabriel Block user comment: N Private report: N New Comment: Also Locale::setDefault from https://bugs.php.net/55173 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#216728) next »