All of a sudden, a script that was working fine for quite some time has stopped, with no error. I've pinned it down to the __contruct method but cannot understand why it's happening. Simplified version of the code....
<?php
class ex1 {
protected $dbh;
function __construct(){
$this->dbh = new PDO('mysql:host=localhost;dbname=db', 'user', 'pw', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));
}
}
?>
<?php
include('ex1.class.php');
class ex2 extends ex1 {
somefunc(){
is_object($this->dbh); // = FALSE
}
}
?>
The PDO constructor works on its own, in fact nothing I put in the ex1 constructor seems to run and no errors in the logs (set to E_ALL & E_STRICT).
Any ideas?