#31008 [Fbk->Csd]: Possible bug in the example code
| From: | nlopess@php.net | Date: | Wed, 08 Dec 2004 12:00:16 +0000 |
| Subject: | #31008 [Fbk->Csd]: Possible bug in the example code | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969365391@lists.php.net to get a copy of this message | ||
ID: 31008
Updated by: nlopess@php.net
Reported By: afjoijojifaj9foobar dot 5 dot rdancer at spamgourme
-Status: Feedback
+Status: Closed
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2004-12-07 22:59:26] philip@php.net
The code in question is actually here:
http://php.net/manual/en/language.oop.php
------------------------------------------------------------------------
[2004-12-07 21:40:14] nlopess@php.net
Where is that code?
Tha page you specified doesn't have any example.
------------------------------------------------------------------------
[2004-12-07 16:17:00] goba@php.net
Docproblem.
------------------------------------------------------------------------
[2004-12-07 12:35:50] afjoijojifaj9foobar dot 5 dot rdancer at
spamgourme
Description:
------------
The test in the remove_item() function should be
if ($this->items[$artnr] >= $num)
^^
Cheers,
Jan Minář
"http://uk2.php.net/manual/en/language.oop5.php":
<?php
class Cart {
var $items; // Items in our shopping cart
// Add $num articles of $artnr to the cart
function add_item($artnr, $num) {
$this->items[$artnr] += $num;
}
// Take $num articles of $artnr out of the cart
function remove_item($artnr, $num) {
if ($this->items[$artnr] > $num) {
$this->items[$artnr] -= $num;
return true;
} else {
return false;
}
}
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31008&edit=1