Predefined Variables, Exceptions, Interfaces, and Classes Flashcards
What are the superglobals?
$GLOBALS $_SERVER $_GET $_POST $_FILES $_COOKIE $_SESSION $_REQUEST $_ENV
What is $php_errormsg?
It contains the text of the last error message generated by PHP. This variable will only be available within the scope in which the error occurred, and only if the track_errors configuration option is turned on (it defaults to off).
What is $http_response_header?
The $http_response_header array is similar to the get_headers() function. When using the HTTP wrapper, $http_response_header will be populated with the HTTP response headers. $http_response_header will be created in the local scope.
What is $argc?
It contains the number of arguments passed to the current script when running from the command line.
What is $argv?
It contains an array of all the arguments passed to the script when running from the command line.
What is Exception?
Exception is the base class for all exceptions.
Are Exceptions clonable?
No.
What is ErrorException?
A predefined error exception class that extends Exception.
What are the predefined interfaces and classes?
Traversable Iterator IteratorAggregate ArrayAccess Serializable Closure Generator
How can Traversable be implemented?
It’s an abstract base class that cannot be implemented alone. It must be implemented by either IteratorAggregate or Iterator. It has no methods.
Can generator objects be instantiated with new?
No.