PHP Level 1

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Johnkawakami
J
Johnkawakami
Community Contributor
Quizzes Created: 3 | Total Attempts: 3,430
| Attempts: 868 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Which of the following is an example of the use of an arithmetic operator?

Explanation

In C, the "+" is an arithmetic operator. The other operator, in D, is =, which is an assignment operator.

Submit
Please wait...
About This Quiz
PHP Quizzes & Trivia

This tests your basic understanding of PHP software development, including general programming concepts like recursion, functions, and objects. Passing the test indicates that you recognize and... see moreunderstand basic computer programming, beyond copying data from forms into page layouts, and understand the terminology related with basic computer programming. see less

2. Which of the following is a function call.

Explanation

The function is fib(). Choice E is incorrect, because it's a function definition. A "call" is when you use a function.

Submit
3. Which of the following doesn't look like PHP code?

Explanation

D is a mishmash of Javascript and VBScript, and uses the dot notation for objects. PHP uses the arrow notation.

Submit
4. Which of the following is not a supported syntax to call a method on an object or a class?

Explanation

C - the dot notation is not supported. Choice E is legitimate.

Submit
5. You have a large array of names, sorted randomly, and you need to extract all the names that start with the letter "M". What kind of magical PHP incantations will appear in your code?

Explanation

C will produce the shortest code. It's esoteric, but easy to understand once you understand it. D and E were red herrings.

Submit
6. Computer scientists like recursion.  In the real world, especially on multi-user situations like PHP faces, recursion isn't so popular.  There are many reasons why people forego recursion.  Which of the following is usually not a reason.

Explanation

If it's easily solved by recursion, it's rarely every easier to solve it with arrays.

Submit
7. PHP runs on many platforms, mainly Unixes.  When you run code developed on a Snix machine and move it over to a Windows server, which issue below is not likely to be a problem.

Explanation

C is a red herring. OLE is a Windows technology.

Submit
8. You whipped up a little MySQL database backed website, and now the traffic has exploded.  The server is slowing down.  Listed are some ways you can reduce the load.  Which will give you the least gain?

Explanation

B - the bottleneck is the database and the fact it goes to disk to get results. An object cache only helps avoid compilation, but doesn't address the DB speed issue. Separating the database to its own machine is also not likely to help much normally, but, simply doubling the number of CPUs will definitely gain performance on heavily loaded servers.

Submit
9. Here is a dense, faulty bit of PHP code that just won't work.  You know, the kind your coworker wrote (lulz).  All of the following reasons, except one, are reasons why the code isn't working.
$a = $POST['name'];
print 'Hello $a ';
include('db_layer.inc.php'); // connects to db
$db = new db();
$db->insert("insert into foobar (name) $a");
?>

Explanation

D - while not sanitizing input is punishable by humiliation, it won't prevent the code from running.

Submit
10. Your client says they want to build a clone of Craigslist or Kijiji.  You think they're nuts, but they convince you they can do it.  Around how many data tables do you think it will take?

Explanation

It's a pretty small application, despite it's popularity. C or D could be correct answers.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 17, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 17, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 14, 2009
    Quiz Created by
    Johnkawakami
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which of the following is an example of the use of an arithmetic...
Which of the following is a function call.
Which of the following doesn't look like PHP code?
Which of the following is not a supported syntax to call a method on...
You have a large array of names, sorted randomly, and you need to...
Computer scientists like recursion.  In the real world,...
PHP runs on many platforms, mainly Unixes.  When you run code...
You whipped up a little MySQL database backed website, and now the...
Here is a dense, faulty bit of PHP code that just won't work. ...
Your client says they want to build a clone of Craigslist or...
Alert!

Advertisement