|
<?php /** * @date Tue Mar 11 01:49:44 CST 2008 * @user BianYuan * @todo PHP5 类型提示 * */ class DB { function __construct() { // DB CONNECT
} } class WebApp { private $DB; function __construct(DB $db) { $this->DB = $db; } function run() {} } $dbLink = new DB(); $misc = null; $app = new WebApp($misc);
//<b>Catchable fatal error</b>: Argument 1 passed to WebApp::__construct() must be an instance of DB, null given, called in PHPDocument2 on line 21 and defined in <b>PHPDocument2</b> on line <b>14</b><br /> ?>
|