Search code examples
boolean-operations

Why am I getting error "Call to a member function getInvoiceID() on boolean" in PHP?


enter image description here

Hi. I would like to know the theory behind why this error occurs.

"Call to a member function getInvoiceID() on boolean".

Is it because the datatype does not match with the returned function getInvoiceID()?


Solution

  • My guess is because you called getInvoiceID() on an boolean, not an object. Check your variable assignment, it may be caused by a function that return boolean on fail instead of object. Please provide your code.