what does undefined offset mean??
it's on the line below. (part of an xml parser)
$depth[$parser]++;
Undefined offset
Moderator: General Moderators
usually that you try to access an key/element that does not exist within the arrayin your case it's probably because ofsorry 
Code: Select all
$arr = array('a'=>'A', 'b'=>'B');
echo $arr['z'];Code: Select all
class MyClass
{
// fill me with something useful if you must
}
$obj = new MyClass;
$dh = opendir('.');
$parser = xml_parser_create();
$arr = array($obj=>"doesn't work", $dh=>'this neither', $parser=>'bad luck again');
print_r($arr);of what type is $parser?
The example above only states that ressources and objects cannot be used as array-keys (yet?)
if the key can be used, the line will be executed as you can test with
The example above only states that ressources and objects cannot be used as array-keys (yet?)
if the key can be used, the line will be executed as you can test with
Code: Select all
<html><body>
<pre><?php
error_reporting(E_ALL);
ini_set('display_errors', true);
$arr = array();
$arr[0]++;
print_r($arr);
?></pre>
</body></html>