Reply
Sat 19 Feb, 2022 10:35 am
Hi,
I am using this book called Learn PHP 8. I found the books code on a website. I compared the two scripts, they are the same. I ran the authors code and it gets the same error as my code. Here is the lines of code that are giving me the errors.
$lab = new Dog;
$dog_error_message = $lab->set_dog_name('Fred');
print $dog_error_message == TRUE ? 'Name update successful<br/>' : 'Name update not successful<br/>';
Here is the error that I get: Uncaught Error: Call to undefined method Dog::set_dog_name()
I have tried to find the problem, but when two different pieces of code do the same error I am at a loss