Answers for "phpstorm using extract to create variales"

0

phpstorm using extract to create variales

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";
    };
}
Posted by: Guest on June-24-2021

Browse Popular Code Answers by Language