PHP - IT & Programming
Practice questions to test your knowledge and improve your understanding.
Which PHP variable name is invalid?
Which of the following are valid PHP data types?
Which of the following type cast is not correct?
What will be the output of following code:-
Which of the following functions is not related to garbage collection in PHP?
What function computes the difference of arrays?
What would be the output of the following code? $parts = parse_url("https://example.com/test/1234?testing&val&id=1&&=23&row=4"); parse_str($parts['query'], $query); echo count($query);
What is the difference between the include() and require() language constructs?
What is the output of the following code?
What will it output?
What does the return code E_ERROR indicate?
Why is PHP more widely used than ASP?
How to call a method from within a class?
Which PHP function returns "true" if a value already exists in an array?
Which function can you use in error handling to stop the execution of a script and is equivalent to exit()?
How do single quotes interpret strings in PHP?
Which construct is typically used for exception handling in PHP?
The concatenation operator in PHP is
Which of the following will detect which request type was used (GET, POST, PUT or DELETE)?
Which datatypes are treated as arrays in some cases?
Which of the following function libraries are supported in PHP?
What does the following PHP statement create? define("FIRST-NAME","John");
Without introducing a non-class member variable, which of the following can be used to keep an eye on the existing number of objects of a given class?
Which PHP function checks to see if HTTP headers have been sent?
What is the job of the controller as a component in MVC?
Is there a function to listen on E_ERROR (fatal) errors?
Which of these does not represent a single, valid PHP variable
Which result will produce this code? class A { private $property = 1; public function getProperty() { return $this->property; } } class B extends A { protected $property = 2; public function __construct($v) { $this->property = $v; } } class C extends B { public $property = 3; } $c = new C(4); echo $c->property; echo $c->getProperty();
The ** operator is useful for sorting operations. It compares two values and returns an integer less than, equal to, or greater than 0 depending on whether the value on the ** is less than, equal to, or greater than the other.
Which function is used to perform a regular expression match in PHP?
Which of the following is not a PHP magic constant?
Placing the ____ symbol before a function tells PHP to suppress any errors generated by that function.
Which method is used to capture the whole screen in PHP?
Which function allows you to delete a file?
Which of the following code snippet is True for Convert JSON string to Object?
Which of the following is not a valid PHP variable type conversion?
Which of the following is the correct way to check if a session has already been started?
Which of the following modifiers are allowed for methods in an Interface? (choose all that apply)
A _________ is a way to store information (in variables ) to be used across multiple pages.
What is meant by nl2br()?
Which of the following are valid MySQLi Configuration Options? (choose all that apply)
class A{} class_alias( 'A', 'B' ); var_dump(new B); outputs ...
Which one removes a cookie from client's browser?
What is the best way to load a file that contains necessary functions and classes?
What is a key difference between GET and POST?
What is the default maximum execution time for a PHP script?
How do I typecast a variable to boolean?
What is the output of this line of code?"; echo is_finite(log(0)) . ""; echo is_finite(2000); ?>
dirname(__FILE__) will return what?
Which statement returns the number of characters in the string variable $a?