200-710 Exam Question 16

What would be the output ofthe following code?
namespace MyFramework\DB;
class MyClass {
static function myName() {
return _METHOD_;
}
print MyClass::myName();
  • 200-710 Exam Question 17

    Consider the following two files. When you run test.php, what would the output look like?
    test.php:
    include "MyString.php";
    print",";
    print strlen("Hello world!");
    MyString.php:
    namespace MyFramework\String;
    function strlen($str)
    {
    return \strlen($str)*2; // return double the string length
    }
    print strlen("Hello world!")
  • 200-710 Exam Question 18

    Consider the following table data and PHP code. What is the outcome?
    Table data (table name "users" with primary key "id"):

    PHP code (assume the PDO connection is correctly established):
    $ dsn = 'mysql:host=localhost;dbname=exam';
    $ user= 'username';
    $ pass='********';
    $ pdo = new PDO{$dsn, $user, $pass);
    $ cmd ="SELECT* FROM users WHERE id= :id";
    $ stmt = $pdo->prepare($cmd);
    $ id = 3;
    $ stmt->bindParam('id', $id);
    $ stmt->execute();
    $ stmt->bindColumn{3, $result);
    $ row= $stmt->fetch(PDO::FETCH_BOUND);
  • 200-710 Exam Question 19

    Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really
    been uploaded via HTIP, and also save the contents into another folder?

    200-710 Exam Question 20

    Which PHP function sets a cookie whose value does not get URL encoded when sending it to the
    browser?