我想定义带有PDOStatement扩展的新类,在这个子类中我需要覆盖函数bindColumn(PDOStatement::bindColumn),并在此覆盖函数中调用parent :: bindColumn()。但我找不到此方法的默认值。有没有办法在我想覆盖的任何方法中找到默认值?在源代码或某处? 我需要覆盖更多功能,我想找到任何默认值。谢谢
class myStatement extends PDOStatement
{
public function bindColumn ($column, &$param, $type = ?, $maxlen = ?, $driverdata = ?)
{
}
}
答案 0 :(得分:0)
此方法的签名是:
public function bindColumn ($column, &$param, $type = null, $maxlen = null, $driverdata = null) {}
您可以使用像PHPStorm这样的现代IDE来查找任何方法的签名和其他有用信息
答案 1 :(得分:0)
我发布此答案的唯一原因是我不能将其作为评论发布。
/**
* (PHP 5 >= 5.1.0, PECL pdo >= 0.1.0)<br/>
* Bind a column to a PHP variable
* @link http://php.net/manual/en/pdostatement.bindcolumn.php
* @param mixed $column <p>
* Number of the column (1-indexed) or name of the column in the result set.
* If using the column name, be aware that the name should match the
* case of the column, as returned by the driver.
* </p>
* @param mixed $param <p>
* Name of the PHP variable to which the column will be bound.
* </p>
* @param int $type [optional] <p>
* Data type of the parameter, specified by the PDO::PARAM_* constants.
* </p>
* @param int $maxlen [optional] <p>
* A hint for pre-allocation.
* </p>
* @param mixed $driverdata [optional] <p>
* Optional parameter(s) for the driver.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function bindColumn ($column, &$param, $type = null, $maxlen = null, $driverdata = null) {}
让自己成为一个体面的IDE人,它会创造奇迹。