<?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);
//Catchable fatal error: Argument 1 passed to WebApp::__construct() must be an instance of DB, null given, called in PHPDocument2 on line 21 and defined in PHPDocument2 on line 14