0

我想用 PDOStatement 的扩展定义新类,在这个子类中我需要覆盖函数 bindColumn ( PDOStatement::bindColumn ),并且在这个覆盖函数中调用 parent::bindColumn()。但我找不到此方法的默认值。有没有办法在我想覆盖的任何方法中找到默认值?在源代码或某处?我需要覆盖更多功能,我想找到任何默认值。谢谢

class myStatement extends PDOStatement
{

    public function bindColumn ($column, &$param, $type = ?, $maxlen = ?, $driverdata = ?)
    {

    }

}
4

2 回答 2

0

此方法的签名是:

public function bindColumn ($column, &$param, $type = null, $maxlen = null, $driverdata = null) {}

例如,您可以使用 PHPStorm 等现代 IDE 来查找任何方法的签名和其他有用信息

于 2017-11-20T08:11:43.487 回答
0

我将其发布为答案的唯一原因是我无法将其发布为评论。

/**
 * (PHP 5 &gt;= 5.1.0, PECL pdo &gt;= 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 人,它会产生奇迹。

于 2017-11-20T08:11:49.297 回答