Jump to content

Stop fatal error on abstract class instantiation


br0ken

Recommended Posts

When I try to instantiate an abstract class a fatal error occurs. Is it possible to somehow suppress this error and return it as a string so that execution can continue?

 

If this isn't possible, is there a way to test whether or not a certain class is abstract before trying to instantiate it?

 

Thanks in advance!

Please ignore my question! Although I've been Googling this subject for a while, I didn't stumble across what I was looking for until just after I posted.

 

If any one wants to know how to figure out whether or not a class is abstract at run time see the following link:

 

http://php.net/manual/en/class.reflectionclass.php

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.