note 82638 added to ref.xml
| From: | galendotsenoglesatgmaildotcom at osu1 dot php dot net | Date: | Sat, 19 Apr 2008 19:10:15 +0000 |
| Subject: | note 82638 added to ref.xml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138542@lists.php.net to get a copy of this message | ||
I used shawn's code that is an ongoing fix/update of a very nice php 4 & 5 compatible
class.
It works great, only it kept giving me errors when the array isn't set, (I have errors set to
show all).
<?php
Here is the old function that gave errors:
function makeChildNode() {
if (!is_array($this->pointer['child_nodes'])){
$this->pointer['child_nodes'] = array();
}
return count($this->pointer['child_nodes']);
}
Here is the new function that does not spit errors:
function makeChildNode() {
if (!isset($this->pointer['child_nodes'])){
$this->pointer['child_nodes'] = array();
}
return count($this->pointer['child_nodes']);
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 24.199.49.211
----
Manual Page -- http://www.php.net/manual/en/ref.xml.php
Edit -- https://master.php.net/note/edit/82638
Del: integrated -- https://master.php.net/note/delete/82638/integrated
Del: useless -- https://master.php.net/note/delete/82638/useless
Del: bad code -- https://master.php.net/note/delete/82638/bad+code
Del: spam -- https://master.php.net/note/delete/82638/spam
Del: non-english -- https://master.php.net/note/delete/82638/non-english
Del: in docs -- https://master.php.net/note/delete/82638/in+docs
Del: other reasons-- https://master.php.net/note/delete/82638
Reject -- https://master.php.net/note/reject/82638
Search -- https://master.php.net/manage/user-notes.php