如何找到扩展 class 方法的默认值
How to find default value of extend class method
我想用 PDOStatement 的扩展定义新的 class 并且在这个子 class 中我需要覆盖函数 bindColumn (PDOStatement::bindColumn) 并且在这个覆盖函数调用中 parent::bindColumn()。但我找不到此方法的默认值。有没有办法在我想覆盖的任何方法中找到默认值?在源代码或某处? 我需要覆盖更多功能,我想找到任何默认值。谢谢
class myStatement extends PDOStatement
{
public function bindColumn ($column, &$param, $type = ?, $maxlen = ?, $driverdata = ?)
{
}
}
这个方法的签名是:
public function bindColumn ($column, &$param, $type = null, $maxlen = null, $driverdata = null) {}
您可以使用像 PHPStorm 这样的现代 IDE 来查找任何方法的签名和其他有用的信息
我 post 将其作为答案的唯一原因是我不能 post 它作为评论。
/**
* (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男人,效果很好
我想用 PDOStatement 的扩展定义新的 class 并且在这个子 class 中我需要覆盖函数 bindColumn (PDOStatement::bindColumn) 并且在这个覆盖函数调用中 parent::bindColumn()。但我找不到此方法的默认值。有没有办法在我想覆盖的任何方法中找到默认值?在源代码或某处? 我需要覆盖更多功能,我想找到任何默认值。谢谢
class myStatement extends PDOStatement
{
public function bindColumn ($column, &$param, $type = ?, $maxlen = ?, $driverdata = ?)
{
}
}
这个方法的签名是:
public function bindColumn ($column, &$param, $type = null, $maxlen = null, $driverdata = null) {}
您可以使用像 PHPStorm 这样的现代 IDE 来查找任何方法的签名和其他有用的信息
我 post 将其作为答案的唯一原因是我不能 post 它作为评论。
/**
* (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男人,效果很好