<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$first = "MySQL's test";
var_dump($first);
var_dump($session->quoteName($first));
$second = 'Another `test` "like" `this`';
var_dump($second);
var_dump($session->quoteName($second));
?>
The above example will output
something similar to:
string(12) "MySQL's test"
string(14) "`MySQL's test`"
string(28) "Another `test` "like" `this`"
string(34) "`Another ``test`` "like" ``this```"