':name' => 'Qiang'

Hi. I saw this piece of code in the docs:




$db->createCommand('INSERT INTO customer (name) VALUES (:name)', [

    ':name' => 'Qiang',

])->execute();



The ":" looks redundant when supplying the args.

This looks much cleaner to me:




$db->createCommand('INSERT INTO customer (name) VALUES (:name)', [

    'name' => 'Qiang',

])->execute();



Both ways should work, imo having the : is more explicit. This is a feature of PDO, nothing that yii has invented.

It’s not only PDO, it’s DBMS prepared statements.