I'm relatively new to PHP and I've been trying to understand the concept of method overloading and overriding in PHP. From my research, I know that these concepts are common in object-oriented programming languages like Java, but I'm not sure if PHP supports them as well.
I've been trying to implement these concepts in a PHP class, but I'm not getting the expected results. I have a class with multiple methods with the same name but with different parameters, which I believe is called method overloading. However, when I try to call these methods with different arguments, only the last defined method is being executed.
I also tried to override a method in a child class, but the parent class method seems to be the one that is always being called.
Am I doing something wrong, or is method overloading and overriding not supported in PHP? If it is supported, could you please provide some examples or code snippets to help me understand how it works in PHP?
I appreciate any help or guidance you can provide. Thanks in advance!