📜  phpstorm 使用提取创建变量 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:32.526000             🧑  作者: Mango

代码示例1
public function db(){
    $db = new SQLite3('db/mysqlitedb.db');

    $payments = $db->query('SELECT * FROM payments');

    while ($pay = $payments->fetchArray()){
        /**
         * @var string $to_user
         * @var string $from_user
         * @var number $amount
         */
        extract($pay);
        if (isset($to_user, $from_user, $amount))
            echo "TO: {$to_user}| FROM: {$from_user}| $ {$amount} \n";
    };
}