php - Peculiar situation inside an if loop -
i find myself in very peculiar situation . issue function trying call inside if loop not work . if call same function without if loop works fine . $this->build($passed_menu_id, $id_link);. if condition works absolutely fine because echo "hello" gets printed . means going inside loop not executing function .
this scenario working fine
function menu($passed_menu_id, $id_link) { $this->array_collection = array(); $this->menu_collection = array(); $this->menu_id = $this->_pickmenuid($passed_menu_id); $this->build($passed_menu_id, $id_link); }
this scenario not work
function menu($passed_menu_id, $id_link) { $this->array_collection = array(); $this->menu_collection = array(); $this->menu_id = $this->_pickmenuid($passed_menu_id); if($this->menu_id==1003){ echo "hello"; $this->build($passed_menu_id, $id_link); }
thanks time in advance
in second scenario missing }
: should be
function menu($passed_menu_id, $id_link) { $this->array_collection = array(); $this->menu_collection = array(); $this->menu_id = $this->_pickmenuid($passed_menu_id); if($this->menu_id==1003){ echo "hello"; $this->build($passed_menu_id, $id_link); } // missing }
other there nothing in code should stop if
functioning way should
Comments
Post a Comment