php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53047 Example code refers to undefined variable
Submitted: 2010-10-12 22:30 UTC Modified: 2010-10-19 06:33 UTC
From: jeff at lyonbros dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jeff at lyonbros dot com
New email:
PHP Version: OS:

 

 [2010-10-12 22:30 UTC] jeff at lyonbros dot com
Description:
------------
See the page at http://us3.php.net/manual/en/mongocollection.remove.php

Scroll down to Example #1

$uranium->remove(array('type' => 94), array("justOne" => true));

$uranium is undefined in the example. It needs to be a MongoCollection object for 
the example to be functional.

Test script:
---------------
<?php

$radioactive = $db->radioactive;

// count how much more plutonium there is
$remaining = $radioactive->count(array('type' => 94));

$halflife = $remaining/2;

// remove half of it
while ($halflife > 0) {
    $uranium->remove(array('type' => 94), array("justOne" => true));
    $halflife--;
}

?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-19 06:33 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=304497
Log: Fixed bug #53047 (Example code refers to undefined variable)

# Also fixed the changelog order
 [2010-10-19 06:33 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-10-19 06:33 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=68092637d0e96d6fbc992cff8e2f2e49192a4ec3
Log: Fixed bug #53047 (Example code refers to undefined variable)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC