php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54118 splobjectstorage::offsetset
Submitted: 2011-02-28 11:55 UTC Modified: 2011-03-01 11:23 UTC
From: lsmith@php.net Assigned: rquadling (profile)
Status: Closed Package: SPL related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2011-02-28 11:55 UTC] lsmith@php.net
Description:
------------
The second parameter is optional:
http://php.net/manual/en/splobjectstorage.offsetset.php

Test script:
---------------
[11:50] <lsmith> http://ch2.php.net/manual/en/splobjectstorage.offsetset.php
[11:50] <lsmith> so there the docs say again that the second param isnt optional
[11:50] <ekneuss> in that case it's optional yes (in the implementation)
[11:51] <ekneuss> the thing is, SplObjectStorage is a map without a need for any value
[11:51] <lsmith> ok
[11:51] <lsmith> so the docs should be fixed?
[11:51] <ekneuss> so it can be seen both as a set and a map
[11:51] <ekneuss> I guess yes
[11:51] <lsmith> ok



Patches

SPLObjectStorage_offsetSet_Reflection (last revision 2011-02-28 11:56 UTC by rquadling@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-28 12:55 UTC] rquadling@php.net
-Package: Documentation problem +Package: SPL related
 [2011-02-28 12:55 UTC] rquadling@php.net
The reflection information in spl_observer.c also needs to be changed making this not just a Documentation issue.

As SPLObjectStorage::offsetSet() is an alias for SPLObjectStorage::attach(), either ...

ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetSet, 0, 0, 2)

should be ...

ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetSet, 0, 0, 1)

This would then make the reflection match (php --ri SPLObjectStorage)


OOI, as this is an aliases (and others exist for SPLObjectStorage), why bother with these methods having their own ARG_INFO structures at all? Just use the structure from the aliased method?
 [2011-02-28 12:56 UTC] rquadling@php.net
The following patch has been added/updated:

Patch Name: SPLObjectStorage_offsetSet_Reflection
Revision:   1298894192
URL:        http://bugs.php.net/patch-display.php?bug=54118&patch=SPLObjectStorage_offsetSet_Reflection&revision=1298894192
 [2011-03-01 01:13 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=308784
Log: - Fixed SplObjectStorage::offsetSet arginfo, reported in bug #54118
 [2011-03-01 11:23 UTC] rquadling@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: rquadling
 [2011-03-01 11:23 UTC] rquadling@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 00:01:24 2020 UTC