Hello,
I have the situation shown below in the code:
I get the following warning and error:
Notice: Undefined variable: valon
and
Fatal error: Call to a member function passes() on a non-object
I can't see anything wrong with the code. check() returns an object of class Val which is assigned to $valon, $valon then calls a member function of class Val. Could you please help. Please let me know whether to include further code.
I have the situation shown below in the code:
Code:
if(//condition is met)
{
$val = new Val();
$valon = $val->check($_POST, array(.........));
}
if($valon->passes())
{
$use = new Use();
........
}
//check() and passes() both belong to class Val
public function check($source, $items = array())
{ ...........
...........
return $this;
}
I get the following warning and error:
Notice: Undefined variable: valon
and
Fatal error: Call to a member function passes() on a non-object
I can't see anything wrong with the code. check() returns an object of class Val which is assigned to $valon, $valon then calls a member function of class Val. Could you please help. Please let me know whether to include further code.