php

Zend PHP5 certification Exam study review 11: supplementary II

January 24, 2008 · 4 min read

You can determine if you can seek an arbitrary stream in PHP with the stream_get_meta_data() function The $params[’notification’] context variable allows you to define a callback for the stream that will notify your script of certain events during the course of the transaction. The PDOStatement->nextRowset() method in the PDOStatement class is used to return the next result set in a multi-query statement. SimpleXML objects can be created from what types of data sources? File URL String During an HTTP authentication, how does one determine the username and password provided by the browser?predefined variables PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE set to the user name, password and authentication type respectively. These predefined variables are found in the $_SERVER and $HTTP_SERVER_VARS arrays. $_SERVER[‘PHP_AUTH_USER’] $_SERVER[‘PHP_AUTH_PW’] End a script in PHP5:__halt_compiler() ; die(); exit(); When checking to see if two variables contain the same instance of an object, which of the following comparisons should be used?=== When an object is serialized, which method will be called, automatically, providing your object with an opportunity to close any resources or otherwise prepare to be serialized?serialize — Generates a storable representation of a value. When serializing objects, PHP will attempt to call the member function __sleep() prior to serialization. This is to allow the object to do any last minute clean-up, etc. prior to being serialized. Likewise, when the object is restored using unserialize() the __wakeup() member function is called. Which of the following are examples of the new engine executor models available in PHP 5?Three execution models (CALL, GOTO, SWITCH) that the new virtual machine of PHP 5.1SwitchConditionalGoto CallDynamic The array_sum() function is used to add up the values of every entry within an array. The children() method can be used from a SimpleXML node to return an iterator containing a list of all of the current node’s sub nodes. To destroy one variable within a PHP session you should use which method in PHP 5? session_destroy(); session_regenerate_id(); Unlike a database such as MySQL, SQLite columns are not explicitly typed. Instead, SQLite catagorizes data into which of the following catagories? Textual and Numeric Which two internal PHP interfaces provide functionality which allow you to treat an object like an array?Iterator ArrayAccess The stream_set_timeout() function is used to modify the amount of time PHP will wait for a stream before timing out during reading or writing. In a general sense, which is more important: performance or maintainability of an application? maintainability first, performance second. When using a function such as strip_tags, are markup-based attacks still possible?yes. string strip_tags ( string $str [, string $allowable_tags ] ) Which of the following are valid PHP variables?@$foo // &$variable ${0x0} $variable // $0x0 Unlike the old MySQL extension, the new MySQLi extension requires that you provide what when performing a query when using the procedural interface?Procedural style: mixed mysqli_query ( mysqli $link , string $query [, int $resultmode ] ) A FOREIGN key is particularly useful for maintaining data integrity within your database, and has the potential to ease the complexity of your PHP scripts by allowing the database to manage cascading deletes of data. If you would like to store your session in the database, you would do which of the following?Create functions for each session handling step and use session_set_save_handler() to override PHP’s internal settings One can determine if it is possible to send HTTP headers from within your PHP script using which of the following functions?bool headers_sent ([ string &$file [, int &$line ]] ) Check to make sure we haven’t already sent the header:!in_array(“Location: $url”, headers_list()) The tempnam function is used to generate a file resource in the file system with a randomly-generated filename to be used as temporary storagestring tempnam ( string $dir , string $prefix ) Creates a file with a unique filename, with access permission set to 0600, in the specified directory. If the directory does not exist, tempnam() may generate a file in the system’s temporary directory, and return the name of that.

← Back to all posts