Terms Of PHP Test Quiz

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 BrokenTrack
B
BrokenTrack
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,054
| Attempts: 1,054 | Questions: 15
Please wait...
Question 1 / 15
0 %
0/100
Score 0/100
1. You can execute Linux commands with php on a Linux based server.

Explanation

This statement is true because PHP is a server-side scripting language that can be used to execute commands on a Linux based server. PHP has built-in functions and libraries that allow developers to interact with the operating system and execute Linux commands. This capability is particularly useful for tasks such as file manipulation, system administration, and server management. Therefore, it is possible to execute Linux commands using PHP on a Linux based server.

Submit
Please wait...
About This Quiz
Terms Of PHP Test Quiz - Quiz

How far goes your knowlegde in the terms of PHP?

2. You can make a zip with php.

Explanation

In PHP, the "zip" extension allows you to create, open, and extract files from ZIP archives. This extension provides functions to create a new ZIP file, add files to an existing ZIP file, and extract files from a ZIP file. Therefore, it is possible to make a zip with PHP, making the answer "True" correct.

Submit
3. How do you browse through an array?

Explanation

The correct answer is "foreach($array as $key => $value) {}". This is because the foreach loop is specifically designed for iterating over arrays. It allows you to access each element of the array one by one, assigning the key and value of each element to variables ($key and $value in this case). This loop structure is commonly used for looping through arrays and performing operations on each element.

Submit
4. PHP is client sided.

Explanation

The given statement is incorrect. PHP is a server-side scripting language, not a client-sided one. It is primarily used for generating dynamic web pages and handling server-side tasks such as interacting with databases, processing form data, and generating HTML content to be sent to the client's browser. The client-side refers to the execution of code on the user's browser, which is typically done using languages like JavaScript. Therefore, the correct answer is False.

Submit
5. You can make images with php.

Explanation

PHP is a server-side scripting language that can generate dynamic content. It has built-in functions and libraries that allow developers to create and manipulate images. With PHP, you can create, edit, and manipulate images by using various functions and libraries like GD or ImageMagick. Therefore, the statement "You can make images with PHP" is true.

Submit
6. What is a constructor if you are talking about object orientated programming?

Explanation

A constructor is a pre-defined name of a function that is called first when initializing an object of a class in object-oriented programming. It is responsible for initializing the object's state and performing any necessary setup tasks.

Submit
7. class Animal { public function makeNoise() { echo 'Some kind of noise'; } } class Cat extends Animal { public function makeNoise() { echo 'Meow'; } } $cat = new Cat(); $cat->makeNoise(); What will be the output?

Explanation

The output will be "Meow" because the makeNoise() method in the Cat class overrides the makeNoise() method in the Animal class. When the makeNoise() method is called on the $cat object, it will execute the makeNoise() method in the Cat class, which echoes "Meow".

Submit
8. Is the function preg_replace() or a similar one required to make ubb code?

Explanation

No, the function preg_replace() or a similar one is not required to make UBB code. UBB code is a simple text formatting language that uses tags enclosed in square brackets to format text. It can be implemented using basic string manipulation functions like str_replace() or even with regular expressions. The preg_replace() function is commonly used for more complex pattern matching and replacement tasks, but it is not necessary for basic UBB code implementation.

Submit
9. You can decrypt a string made by the md5() method.

Explanation

The statement is false because the md5() method is a one-way hash function, which means it is designed to be irreversible. It is used for generating a unique hash value for a given input string, but it cannot be decrypted to obtain the original string. Therefore, it is not possible to decrypt a string made by the md5() method.

Submit
10. (int) $i = 1; (int) $j = 2; list($i,$j) = array($j,$i); echo $i; What will be the output?

Explanation

The code initializes two variables, $i with the value of 1 and $j with the value of 2. Then, it uses the list() function to assign the values of $j and $i to $i and $j respectively, effectively swapping their values. Finally, it echoes the value of $i, which is now 2. Therefore, the output will be 2.

Submit
11. $string = null; if($string === '') { echo 'It works!'; } What will be the output?

Explanation

The code checks if the variable $string is identical to an empty string. However, the variable $string is set to null, not an empty string. Therefore, the condition will not be true and the code inside the if statement will not be executed. As a result, there won't be any output.

Submit
12. class Animal { public final function makeNoise() { echo 'Some kind of noise'; } } class Cat extends Animal { public function makeNoise() { echo 'Meow'; } } $cat = new Cat(); $cat->makeNoise(); What will be the output?

Explanation

The given code will give an error. This is because the makeNoise() function in the Animal class is declared as final, which means it cannot be overridden in the child class. However, in the Cat class, the makeNoise() function is trying to override the function in the parent class. Since it is not allowed, an error will occur.

Submit
13. class Animal { private $noise = 'Some kind of noise'; public function makeNoise() { echo self::$noise . ' ; woof woof'; } } $animal = new Animal(); $animal->makeNoise(); What will be the output?

Explanation

not-available-via-ai

Submit
14. Which data can you track with PHP only? Choose all options that apply.

Explanation

With PHP, you can track the IP address of the user visiting your website. The IP address can provide information about the user's location and can be used for various purposes such as tracking user activity or implementing security measures. Additionally, PHP can also track the user agent, which refers to the web browser and operating system being used by the visitor. This information can be helpful for optimizing the website's design and functionality. Lastly, PHP can track the referral URL, which indicates the website or page from which the user originated before landing on your site. This can be useful for analyzing traffic sources and understanding user behavior. However, PHP cannot directly track the MAC address or screen resolution of the user's device.

Submit
15. Check the ones that are incorrect.

Explanation

The question asks to identify the incorrect variables among the given options. The correct answer is "$1var;,$var-iable;,$variäble;". This is because variable names cannot start with a number or contain special characters like hyphens or umlauts. Therefore, "$1var;", "$var-iable;", and "$variäble;" are all invalid variable names.

Submit
View My Results

Quiz Review Timeline (Updated): Aug 1, 2024 +

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

  • Current Version
  • Aug 01, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 24, 2011
    Quiz Created by
    BrokenTrack
Cancel
  • All
    All (15)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
You can execute Linux commands with php on a Linux based server.
You can make a zip with php.
How do you browse through an array?
PHP is client sided.
You can make images with php.
What is a constructor if you are talking about object orientated...
Class Animal {...
Is the function preg_replace() or a similar one required to make ubb...
You can decrypt a string made by the md5() method.
(int) $i = 1;...
$string = null;...
Class Animal {...
Class Animal {...
Which data can you track with PHP only? Choose all options that apply.
Check the ones that are incorrect.
Alert!

Advertisement