Reputation: 4715
I want to extend standard PDO
class. So i have:
namespace Example;
class NewPDO extends PDO {}
but i get the following error :
Fatal error: Class 'Example\PDO' not found in /home/hdocs/lab/index.php on line 4
I know that's because PDO
class is not within Example
namespace.
how can i solve that ?
Upvotes: 0
Views: 759
Reputation: 160973
PDO
is in global namespace, you should add \
before it.
namespace Example;
class NewPDO extends \PDO {}
Upvotes: 5