|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-08-09 20:19 UTC] david dot nqd at gmail dot com
Description: ------------ Hi, The documented return type of ArrayObject::offsetGet is bool, when it should it be mixed (?) The documentation for this function: "Returns the value at the specified $index" which may or may not be boolean. - David PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 00:00:02 2025 UTC |
The source to this function /php-src/ext/spl/spl_array.c /* $Id: spl_array.c,v 1.111 2006/05/20 19:47:18 helly Exp $ */ Lines 493-504 are /* {{{ proto bool ArrayObject::offsetGet(mixed $index) proto bool ArrayIterator::offsetGet(mixed $index) Returns the value at the specified $index. */ SPL_METHOD(Array, offsetGet) { zval *index, *value; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { return; } value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R TSRMLS_CC); RETURN_ZVAL(value, 1, 0); } /* }}} */ As the manual is based upon the proto defined in the source, it LOOKS like the proto is incorrect. Can you give a short proof?