I have a class that is getting called and for some reason one of the functions I have is being found, but the other one is not. Here is my code:
<?php
namespace LMVC\Database;
class PDO
{
private static $instance = NULL;
public static function setup($dsn, $username, $password)
{
try {
self::$instance = new \PDO($dsn, $username, $password);
}
catch(PDOException $e) {
throw new Exception("Error: " . $e->getMessage());
}
}
public static function getInstance()
{
if(self::$instance === NULL) {
throw new Exception("Database is not instantiated");
}
return self::$instance;
}
public function query($sql)
{
if(self::$instance === NULL) {
throw new Exception("Database is not instantiated");
}
try {
return self::$instance->query($sql);
}
catch(PDOException $e) {
throw new Exception("Error: " . $e->getMessage());
}
}
public function fetchAll($stmt)
{
if(self::$instance === NULL) {
throw new Exception("Database is not instantiated");
}
try {
return self::$instance->fetchAll($stmt);
}
catch(PDOException $e) {
throw new Exception("Error: " . $e->getMessage());
}
}
public function prepare()
{
}
public function quote()
{
}
}
All of the functions except fetchAll are able to be found, but fetchAll is not. I can't seem to add functions that exist either. When I change the name of fetchAll to something else it can't find the functoin I rename it to. Also when I get rid of the functions that are able to be found like quote, query, and prepare, php is still able to find them, I tested using var_dump with function exists. I have tried restarting apache, restarting windows 7. I am using php 5.3.1.
Any other ideas on how to debug? I can't seem to find out how to get the error log to work by editing my php.ini file either.