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

From: Date: Mon, 23 Jul 2018 02:32:03 +0000
Subject: Bug #75958 [Opn]: bool return on some SPL methods, not void
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216403@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: carusogabriel@php.net Reported by: oeildanslabouche at gmail dot com Summary: bool return on some SPL methods, not void Status: Open Type: Bug Package: SPL related Operating System: windows PHP Version: 7.1.14 Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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 (#216403) next »