Sample questions
Question 1Medium
- Yahoo.
- Facebook.
- A & B
- None of these.
Answer: C. A & B
Explanation
PHP is used by many websites, including Yahoo and Facebook.
Step-by-step solution
- PHP is used by Yahoo.
- PHP is used by Facebook.
- Yahoo and Facebook both use PHP.
- So the correct answer is A & B.
Why the other options are wrong
- A. Yahoo alone is not the full answer; Facebook also uses PHP.
- B. Facebook alone is not the full answer; Yahoo also uses PHP.
- D. None is wrong because Yahoo and Facebook both use PHP.
Tip: Remember major platforms like Yahoo and Facebook use PHP.
Question 2Medium
Can I run several versions of PHP at the same time?
- Yes.
- No.
Answer: A. Yes.
Explanation
Yes definitely. This kind of setup is useful in development environments where it is necessary to test an application with different PHP versions. Also, it is often used in production environments, where many PHP applications are hosted on the same server and some of them have dependency on a particular PHP version.
Step-by-step solution
- The question asks whether several PHP versions can run on one machine at the same time.
- The explanation says this is useful in development, to test an app with different versions.
- It is also used on shared servers where apps depend on different versions, so the correct answer is option A, Yes.
Why the other options are wrong
- B. No is wrong; several PHP versions can run side by side.
Tip: Running several versions side by side is a normal setup for testing.
Question 3Medium
Which of the following are benefits of php?
- Free of Cost
- Efficiency in Performance
- Familiarity with syntax
- All of the above
Answer: D. All of the above
Explanation
All three are listed benefits of PHP: it is open source and free of cost, it can perform efficiently when coded well, and its syntax is familiar to programmers who know C or Perl. So all of the above is correct.
Step-by-step solution
- PHP is free to use as it is open source, so 'Free of Cost' is a benefit.
- PHP syntax is similar to C and Perl, making it easy for programmers familiar with these languages, so 'Familiarity with syntax' is a benefit.
- PHP can be efficient in performance when coded properly, so 'Efficiency in Performance' is a benefit.
- All three options are benefits of PHP, so the correct answer is 'All of the above'.
- Final Answer: D (All of the above).
Why the other options are wrong
- A. Free of cost is true, but it is only one benefit, so this option alone is incomplete.
- B. Efficiency in performance is true, but it is only one benefit, so this option alone is incomplete.
- C. Familiarity with syntax is true, but it is only one benefit, so this option alone is incomplete.
Tip: Remember PHP has many benefits, including being free and easy to use.
Question 4Medium
- 2001
- 2003
- 2004
- 2005
Answer: C. 2004
Explanation
On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.
In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3.
Step-by-step solution
- The question asks which year PHP 5 was released.
- PHP 5 was released on July 13, 2004, with the Zend Engine II.
- The year 2004 matches option C, so the correct answer is option C.
Why the other options are wrong
- A. 2001 is too early; PHP 5 came out in 2004.
- B. 2003 is before the release date.
- D. 2005 is after the release.
Tip: Learn the release years of major PHP versions as a short list.
Question 5Medium
The windows version of PHP does not have built in support for the calendar extension.
- True
- False
Answer: B. False
Explanation
The calendar extension contains functions that simplifies converting between different calendar formats.It is based on the Julian Day Count, which is a count of days starting from January 1st, 4713 B.C.
Step-by-step solution
- The statement says the Windows build of PHP lacks built-in calendar support.
- The calendar extension converts between calendar formats using the Julian Day Count.
- The Windows build includes this extension, so the statement is false; the correct answer is option B, False.
Why the other options are wrong
- A. True is wrong; the Windows build of PHP does include calendar functions.
Tip: Read negative statements carefully; a claim about a missing feature is often false.
Question 6Medium
Whether php is open source language?
- YES
- NO
Answer: A. YES
Explanation
One great advantage of Open Source software is that it provides the opportunity for adaptation to new environments. This is true of PHP.
Step-by-step solution
- PHP is released under an open source licence.
- Open source software lets users read, change and share the code.
- So the statement that PHP is open source is true, which is option A, YES.
Why the other options are wrong
- B. NO is wrong; PHP is open source software.
Tip: Open source means the code is free to read, use and change; PHP is a common example.
Question 7Medium
For php Support comes in the form of modules called ____.
- Extensions.
- Libraries
- Drivers.
- None of these.
Answer: A. Extensions.
Explanation
Originally, PHP was famous for interfacing with many different database systems, but it also has support for other external systems.
Support comes in the form of modules called extensions. They either compile directly into PHP or are loaded dynamically.
New extensions are added to the PHP project regularly. The extensions expose groups of functions for using these external systems.
Step-by-step solution
- PHP uses modules called extensions for support.
- Extensions can be compiled into PHP or loaded dynamically.
- These extensions provide functions for external systems.
- Support in PHP is provided through extensions.
- Final answer: Extensions.
Why the other options are wrong
- B. Libraries is not the term PHP uses for its modules; PHP calls them extensions.
- C. Drivers are used for database access, but PHP's modules as a whole are called extensions.
- D. None is wrong because PHP modules are called extensions.
Tip: Remember, PHP support comes via extensions.
Question 8Medium
Who is the father of PHP?
- Rasmus Lerdorf
- Willam Makepiece
- Drek Kolkevi
- List Barely
Answer: A. Rasmus Lerdorf
Explanation
Rasmus Lerdorf is known as the father, or creator, of PHP. The other names are not connected with PHP.
Step-by-step solution
- PHP was created by Rasmus Lerdorf in 1994.
- He developed it to track his resume and projects.
- Rasmus Lerdorf is known as the father of PHP.
Why the other options are wrong
- B. Willam Makepiece is not the creator of PHP; the answer is Rasmus Lerdorf.
- C. Drek Kolkevi is not the creator of PHP; Rasmus Lerdorf created it.
- D. List Barely is not the creator of PHP; Rasmus Lerdorf created it.
Question 9Medium
What is php heredoc used for?
- allows creating single line of string without using quotations
- allows creating multiple lines of string without using quotations
- allows creating multiple lines of string with quotations
- allows creating single lines of string with using quotations
Answer: B. allows creating multiple lines of string without using quotations
Explanation
heredoc allows creating multiple lines of string without using quotations
Step-by-step solution
- PHP heredoc is used for writing strings that span multiple lines.
- It does not require closing quotes like single or double quotes.
- This makes it easier to write long texts or HTML in PHP.
- The string ends with a specific identifier on a new line.
- Heredoc is ideal for multi-line strings without quotation marks.
- Final answer: allows creating multiple lines of string without using quotations.
Why the other options are wrong
- A. Heredoc is for multiple lines, so a single line without quotes is not its purpose.
- C. Heredoc does not use quotation marks, so the option that says it does is wrong.
- D. Heredoc is for multiple lines, not a single line written with quotes.
Tip: Use heredoc for multi-line strings without quotes in PHP.
Question 10Medium
- 1998
- 1999
- 2000
- 2001
Answer: C. 2000
Explanation
On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released.
As of August 2008 this branch reached version 4.4.9. PHP 4 is no longer under development nor will any security updates be released
Step-by-step solution
- PHP 4, powered by the Zend Engine 1.0, was released on May 22, 2000.
- So the year is 2000.
- The answer is option C.
Why the other options are wrong
- A. 1998 is too early; PHP 4 was released in 2000.
- B. 1999 is before the May 2000 release.
- D. 2001 is after the release, which was in 2000.
Tip: PHP 4 came out in 2000 and PHP 5 in 2004.
Practise all 10 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →