What three special methods can be used to perform special logic in the event a particular accessed method or member variable is not found? __get($name) __set($set, $val) __call($method, $args) __get() and __set() are called when accessing or assigning an undefined object property, while __call() is executed when calling a non-existent method of a class. * When writing portable database code using PDO, what is the PDO::ATTR_CASE attribute useful for? Force column names to a specific case specified by the PDO::CASE_* constants. *XPath
load('test.xml'); $xpath = new DomXPath($dom); DOMXPath->query() — Evaluates the given XPath expression $nodes = $xpath->query(???????, $dom->documentElement); echo $nodes->item(0)->getAttributeNode('bgcolor')->value . "\n"; ?>http://www.w3schools.com/xpath/xpath_syntax.asp *What should go in the ??????? assignment below to create a Zlib-compressed file foo.gz with a compression level of 9? *What should be replaced in the string ??????? below to open the archive myarchive.gz located in the document root of the www.example.com server and decompress it? compress.zlib:// *In the event of a PDOException, $info is set with the contents of the $errorInfo property of the exception an array of error information about the last operation performed by this database handle. The array consists of the following fields:
Element | Information | 0 | SQLSTATE error code (a five-character alphanumeric identifier defined in the ANSI SQL standard). | 1 | Driver-specific error code. | 2 | Driver-specific error message. |
*In databases that do not support the AUTO_INCREMENT modifier, you must use a**LAST_INSERT_ID(id+1****)**instead to auto-generate a numeric incrementing key.
*Are following incorrect? Only two are wrong, not four.a. function c(MyClass $a = new MyClass())
b. function d($a = null)
c. function e(&$a = 30)
d. function a(&$a = array(10,20,30))
e. function b($a = (10 + 2))
b,c,d.
***How does one create a cookie which will exist only until the browser session is terminated?
bool setcookie ( string $name [, string $value [, int $expire [, string $path [, string $domain [, bool $secure [, bool $httponly ]]]]]] )**If $expire set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).
*If regular expressions must be used, in general which type of regular expression functions available to PHP is preferred for performance reasons?
PHP’s Regular Expression Functions (POSIX Extended). regex
POSIX
ereg functions
Perl-style
preg functions.
Perl-compatible syntax using the PCRE functions. These functions support non-greedy matching, assertions, conditional subpatterns, and a number of other features not supported by the POSIX-extended regular expression syntax.This extension maintains a global per-thread cache of compiled regular expressions (up to 4096).
*Which of the following extensions are no longer part of PHP 5 and have been moved to PECL?
w32api, mysql, PDF, ICONV
*Name three new extensions in PHP 5
SimpleXML,PDO, tidy, MySQLi, sqlite, soap
(hash,Reflection,libxml2-based DOM and XSL extensions DOMXML)
*Which of the following SQL statements will improve SQLite write performance?PRAGMA locking_mode = “Row”;**PRAGMA count_changes = Off; PRAGMA default_synchronous = Off;**PRAGMA default_synchronous = On;PRAGMA locking_mode = “Table”; *What kind of information is acquired when profiling a PHP script? timer, functions executed *The method used to create a new node to be added into an XML document using DOM is the DOMDocument->createElement() method // compare to $z[] = [‘c’, ‘c’, ‘c’]; *Implementing your own PDO class requires which steps from the list below? extending PDO; extending PDOStatement; PDO->setAttribute(PDO::ATTR_STATEMENT_CLASS=>array(string classname, array(mixed constructor_args)) * The implode() function is used to convert an array into a string, maintaining your ability to return the string into an array Which of the following functions allow you to introspect the call stack during execution of a PHP script? array debug_backtrace ( void ) generates a PHP backtrace.