syntax error, unexpected T_OBJECT_OPERATOR in recursive function
I've one problem which may you can help me to tackle. I've an array variable:
array (size=3)
'id' => string '7' (length=1)
'mother' =>
array (size=3)
'id' => string '10' (length=2)
'mother' =>
array (size=1)
'id' => string '13' (length=2)
'father' =>
array (size=1)
'id' => string '9' (length=1)
'father' =>
array (size=3)
'id' => string '8' (length=1)
'mother' =>
array (size=1)
'id' => string '12' (length=2)
'father' =>
array (size=1)
'id' => string '11' (length=2)
When I'm sending this variable to the recursive function I get an error:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in
C:\wamp\www\wordpress\wp-content\plugins\dogs\includes\classes\family_tree.php
on line 62
function painting_tree($tree)
{
foreach ($tree as $key=>$value)
{
//echo $value . '<br />';
if (sizeof($value) > 1)
{
this->painting_tree($value); // 62 line
}
}
}
What I should do that I could solve this problem?
Thank you
No comments:
Post a Comment