Which sentence describes the following regular expression match?
preg_match('/^\d+(?:\.[0-9]+)?$/', $test);
Reveal answer details Close answer details
Correct answerB
Zend · 200-710
Preview real exam questions, verified answers and available explanations before choosing a study plan.
|
Single choice
Which sentence describes the following regular expression match? preg_match('/^\d+(?:\.[0-9]+)?$/', $test); Reveal answer details Close answer detailsCorrect answerB
Multiple choice
What can prevent PHP from being able to open a file on the hard drive (Choose 2)? Reveal answer details Close answer detailsCorrect answersA, B
Single choice
How many elements does the $matches array contain after the following function call is performed? Reveal answer details Close answer detailsCorrect answerC
Single choice
Given the following code, how can we use both traits A and B in the same class? (select all that apply) trait A { public function hello() { return "hello"; } public function world() { return "world"; } } trait B { public function hello() { return "Hello"; } public function person($name) { return ":$name"; } } Reveal answer details Close answer detailsCorrect answerB
Single choice
Your public web application needs to provide access to binary files for registered users only. How would you achieve this? Reveal answer details Close answer detailsCorrect answerC
Single choice
An HTML form has two submit buttons. Reveal answer details Close answer detailsCorrect answerD
Multiple choice
What is the benefit of using persistent database connections in PHP? (Choose two.) Reveal answer details Close answer detailsCorrect answersC, D
Fill in the blank
FILL BLANK What is the output of the following code? ![]() function increment ($val) {$val = $val + 1; } $val = 1; increment ($val); echo $val; Reveal answer details Close answer detailsAccepted answer1
Single choice
What is the name of the function that allows you register a set of functions that implement user-defined session handling? Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the result of the following code? define('PI', 3.14); class T const PI = PI; } class Math {const PI = T::PI; } echo Math::PI; Reveal answer details Close answer detailsCorrect answerB
Single choice
What function can be used to retrieve an array of current options for a stream context? Reveal answer details Close answer detailsCorrect answerC
Single choice
What is cached by an opcode cache? Reveal answer details Close answer detailsCorrect answerA
Single choice
What is the output of the following code? try { class MyException extends Exception {}; try { throw new MyException; catch (Exception $e) { echo "1:"; throw $e; } catch (MyException $e) { echo "2:"; throw $e; } } catch (Exception $e) { echo get_class($e); } Reveal answer details Close answer detailsCorrect answerE
Multiple choice
Which of the following is correct? (Choose 2) Reveal answer details Close answer detailsCorrect answersD, E
Single choice
Given a PHP value, which sample shows how to convert the value to JSON? Reveal answer details Close answer detailsCorrect answerA
Single choice
What is the output of the following code? private $v; public function __construct($v) { $this->v = $v; } public function mul() { return static function ($x) { return isset($this) ? $this->v*$x : self::$sv*$x; }; } } $one = new Number(1); $two = new Number(2); $double = $two->mul(); $x = Closure::bind($double, null, 'Number'); echo $x(5); Reveal answer details Close answer detailsCorrect answerC
Single choice
Which of the following statements is true? Reveal answer details Close answer detailsCorrect answerD
Single choice
Which of the following is an invalid DOM save method? Reveal answer details Close answer detailsCorrect answerB
Single choice
When a class is defined as final it: Reveal answer details Close answer detailsCorrect answerA
Single choice
Which of the following statements is NOT correct? Reveal answer details Close answer detailsCorrect answerA
Single choice
Given the following array: $a = array(28, 15, 77, 43); Which function will remove the value 28 from $a? Reveal answer details Close answer detailsCorrect answerA
Single choice
What method can be used to find the tag <any> via the DOM extension? Reveal answer details Close answer detailsCorrect answerB
Single choice
In the following code, which line should be changed so it outputs the number 2: class A { protected $x = array(); /* A */ public function getX() { /* B */ return $this->x; /* C */ } } $a = new A(); /* D */ array_push($a->getX(), "two"); echo count($a->getX()); Reveal answer details Close answer detailsCorrect answerC
Single choice
What will be the output of the following code? $a = array(0, 1, 2 => array(3, 4)); $a[3] = array(4, 5); echo count($a, 1); Reveal answer details Close answer detailsCorrect answerC
Multiple choice
Which of the following methods are available to limit the amount of resources available to PHP through php.ini? (Choose 2) Reveal answer details Close answer detailsCorrect answersA, C
Single choice
When uploading a file to a PHP script using the HTTP PUT method, where would the file data be found? Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the output of the following code? var_dump(boolval([])); Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the output of the following code? Reveal answer details Close answer detailsCorrect answerA
Single choice
What does the__FILE__constant contain? Reveal answer details Close answer detailsCorrect answerB
Single choice
Which of these elements can be encapsulated by namespaces and made accessible from the outside? Reveal answer details Close answer detailsCorrect answerB
Multiple choice
Which of the following functions are used to escape data within the context of HTML? (Choose 2) Reveal answer details Close answer detailsCorrect answersA, E
Single choice
Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values? Reveal answer details Close answer detailsCorrect answerC
Multiple choice
Which of the following items in the $_SERVER superglobal are important for authenticating the client when using HTTP Basic authentication? (Choose 2) Reveal answer details Close answer detailsCorrect answersD, E
Single choice
The following form is loaded in a browser and submitted, with the checkbox activated: <form method="post"> <input type="checkbox" name="accept" /> </form> In the server-side PHP code to deal with the form data, what is the value of $_POST['accept'] ? Reveal answer details Close answer detailsCorrect answerD
Single choice
The XML document below has been parsed into $xml via SimpleXML. How can the value of <foo> tag <?xml version='1.0'?> <document> <bar> <foo>Value</foo> </bar> </document> Reveal answer details Close answer detailsCorrect answerB |