Jump to content

Exception class in PHP (is this magic?)


enridp

Recommended Posts

I didn't understand you thorpe, I'm talking about Exception class, the built in PHP class.

That class is defined in basic.php, and the method is defined as:

final public function getMessage () {}

How can it works then?

Even in php.net there's a comment at the end about that:

http://www.php.net/manual/es/class.exception.php#84617

 

If the method has not definition why when we use ->getMessage() we get the message?

 

I didn't understand you thorpe, I'm talking about Exception class, the built in PHP class.

That class is defined in basic.php, and the method is defined as:

 

As you just stated. The Exception class is built into PHP so it's not defined in any basic.php file. The class you are looking at within basic.php likely extends the built in PHP Exception class.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.