Home > PHP & Programming > Quizzes > 200-550: Zend Certified PHP Engineer Exam Practice Test 2
200-550: Zend Certified PHP Engineer Exam Practice Test 2
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 27% Most missed: “What is the name of the method that can be used to provide read access to virtua…”
200-550: Zend Certified PHP Engineer Exam Practice Test 2
Time left 00:00
25 Questions

1. Is the following code vulnerable to SQL Injection ($mysqli is an instance of the MySQLi class)? $age = $mysqli->real_escape_string($_GET['age']); $name = $mysqli->real_escape_string($_GET['name']); $query = SELECT * FROM `table` WHERE name LIKE '$name' AND age = $age"; $results = $mysqli->query($query);"
2. What will the following function call print? printf('%010.6f', 22);
3. What is the output of the following code? echo 1" + 2 * "0x02";"
4. Which of the following is used to find all PHP files under a certain directory?
5. You want to access the 3rd character of a string, contained in the variable $test. Which of the following possibilites work? (Choose 2)
6. What will be the output value of the following code? $array = array(1,2,3); while (list(,$v) = each($array)); var_dump(current($array));
7. What will the following code piece print? echo strtr('Apples and bananas', 'ae', 'ea')
8. You work for a shared hosting provider, and your supervisor asks you to disable user scripts to dynamically load PHP extensions using the dl() function. How can you do this? (Choose 2)
9. What is the output of the following code? class Number { private $v; private static $sv = 10; 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);
10. Which of the following can be registered as entry points with a SoapServer instance (choose 2):
11. Which one of the following XML declarations is NOT valid?
12. What is the length of a string returned by: md5(rand(), TRUE);
13. In order to create an object storage where each object would be stored only once, you may use which of the following? (Choose 2)
14. Given the following code, what will the output be: trait MyTrait { private $abc = 1; public function increment() { $this->abc++; } public function getValue() { return $this->abc; } } class MyClass { use MyTrait; public function incrementBy2() { $this->increment(); $this->abc++; } } $c = new MyClass; $c->incrementBy2(); var_dump($c->getValue());
15. What parsing methodology is utilized by the SimpleXML extension?
16. You'd like to use the class MyDBConnection that's defined in the MyGreatFramework \MyGreatDatabaseAbstractionLayer namespace, but you want to minimize *as much as possible* the length of the class name you have to type. What would you do?
17. What is the output of the following code? $f = function () { return hello"; }; echo gettype($f);"
18. Which of the following statements is NOT true?
19. Given the following array: $a = array(28, 15, 77, 43); Which function will remove the value 28 from $a?
20. When would you use classes and when would you use namespaces?
21. Which of the following are valid identifiers? (Choose 3)
22. Which of the following is correct? (Choose 2)
23. What function allows resizing of PHP's file write buffer?
24. Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to 10M". Which of the following configurations could be responsible for this outcome? (Choose 2)"
25. What will be the result of the following operation? $a = array_merge([1,2,3] + [4=>1,5,6]); echo $a[2];