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

From: Date: Wed, 14 Feb 2018 09:59:58 +0000
Subject: Doc->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-213946@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: requinix@php.net Reported by: oeildanslabouche at gmail dot com -Summary: bool return on \SplStack->push(), not void +Summary: bool return on some SPL methods, not void Status: Open -Type: Documentation Problem +Type: Bug Package: SPL related Operating System: windows PHP Version: 7.1.14 Block user comment: N Private report: N New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [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 (#213946) next »