I just started using composer and its autoloader for php. Then I added my own code to the autoloader using psr-0. Everything is fine except when I want to access the PDO (new PDO(…). It seems that its out of scope because the Autoloader expects it in my package (called MyAPP). The Error I am getting is:
PHP Fatal error: Class ‘MyApp\PDO’ not found in /var/www/ws/src/MyApp/WsDatenbank.php
on line 15
My attempts to google ended up unsuccessful.
Please Help – Thanks in Advance
Posting my comment as the answer.
You have to do:
new \PDO()(note the slash). When doing this you are loading the class for the global namespace. Otherwise it will be loaded from the current namespace (in your caseMyApp).