php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74891 [PECL ds] Ds\Pair::clear doesn't exist
Submitted: 2017-07-10 11:39 UTC Modified: 2017-07-10 15:10 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ruzic dot marko at gmail dot com Assigned:
Status: Verified Package: Unknown/Other Function
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-07-10 11:39 UTC] ruzic dot marko at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/ds-pair.clear
---
It appears that there is an error in docs example.

Seems illogical that 
 
$pair = new \Ds\Pair("a", 1);
print_r($pair);

will output

Ds\Pair Object
(
    [0] => 1
    [1] => 2
    [2] => 3
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-10 15:10 UTC] requinix@php.net
-Summary: Possible error in docs +Summary: [PECL ds] Ds\Pair::clear doesn't exist -Status: Open +Status: Verified -Package: Documentation problem +Package: Unknown/Other Function
 [2017-07-10 15:11 UTC] requinix@php.net
Looks like a copy/paste from the Ds\Vector::clear docs.

But Ds\Pair does not have a "clear" method in the first place.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 04:01:31 2024 UTC