Exam Name: LinkedIn PHP Skill Quiz
Exam URL: https://www.linkedin.com/skill-assessments/PHP/quiz-intro/
- What does this code output?
- Which is the most secure way to avoid storing a password in clear text in database?
- What does this script do?
- In the following script, which line(s) will cause an error(s)?
- In a conditional statement, you want to execute the code only if both value are true. Which comparison operator should you use?
- All variables in PHP start with which symbol?
- What is a key difference between GET and POST?
- 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 on whether the value on the _**is less than, equal to, or greater than the other.
- Which are valid PHP error handling keywords?
- Which value equates to true?
- What is missing from this code, which is supposed to create a test cookies?
- What is the value of $total in this calculation?
- What is the purpose of adding a lowercase “u” as a modifier after the final delimiter in a Perl-compatible regular expression?
- Which code snippet uses the correct syntax for creating an instance of the Pet class?
- What is the best way to explain what this script does?
- Which is the correct format for adding a comment to a PHP script?
- PHP supports multiple types of loops. If you wanted to loop through a block of code if and as long a specified condition is true, which type of loop would you use?
- The ignore_user_abort( ) function sets whether a client disconnect should abort a script execution. In what scenario would you, as a web developer, use this function?
- The PHP function array_reduce() takes a callback function that accepts a value carried over each iteration and the current item in the array, and reduces an array to a single value. Which code sample will sum and output the values in the provided array?
- Which PHP script uses a constructor to display the string “Winter is almost over!”?
- How might you troubleshoot a “call to undefined function” error?
- Which line could you NOT use to comment out “Space: the final frontier”?
- What displays in a browser when the following code is written?
- Which operator would you use to find the remainder after division?
- What is the significance of the three dots in this function signature?
- Assuming the Horse class exists, which is a valid example of inheritance in PHP?
- Both triple === and double == can be used to **_ variables in php. If you want to hear that string “33” and the number 33 are equal, you would use ** . If you want to check if an array contains a particular string value at a particular index, you would use ___
- Your php page is unexpectedly rendering as totally blank. Which step will shed light on the problem?
- Which is the way to create an array of “seasons”?
- Both self and this are keywords that can be used to refer to member variables of an enclosing class. The difference is that $this->member should be used for __ members and self::$member should be used for __ members.
- What will this code print?
- You are using the following code to find a users band, but it is returning false. Which step(s) would solve the problem?
- Which code would you use to print all the elements in an array called $cupcakes?
- What is the cause of ‘Cannot modify header information – headers already sent’?
- Which php control structure is used inside a loop to skip the rest of the current loops code and go back to the start of the loop for the next iteration
- The php not operator is !. Given the snippet, is there an out put and what is it?
- You want to list the modules available in your PHP installation. What command should you run?
- For the HTML form below, what is the correct functioning script that checks the input “mail” to be sure it is filled before proceeding?
- What is the value of ‘$result’ in this calculation?
- What is the job of the controller as a component in MVC?
- Why does this code trigger an error?
- A PDO object called $db has been set up to use for database operations, including user authentication. All user-related properties are set. The script line public function __construct(&$db) shows a constructor that initializes all user-related properties to ____ if no user has logged in. These parameters will be properly set by the login functions when a user logs in.
- Assuming that $first_name and $family_name are valid strings, which statement is invalid?
- Which code snippet demonstrates encapsulation?
- The following XML document is in books.xml. Which code will output “Historical”?
- Where is PHP code executed?
- Which command will extract the domain suffix (“com”) from the string $string = “https://cat-bounce.com”;?
- Which PHP variable name is invalid?
- What are the recommended settings in the PHP configuration file, php.ini, for a testing environment?
- What are getters and setters?
- Why should you follow a PSR standard?
- You are using the following code to decide if a button is clicked, but it is never returning true. Which step is most likely to shed light on the problem?
- If you want to pass a formfield to another page when a button is clicked, you should use the ** . If you want to store information across multiple pages, you should use the ** ?
- What would be a good name for this function?
- When it comes to the value of a variable, what is the difference between NULL and empty?
- Which is the most complete list of data types that PHP supports?
- In PHP 7, What is the correct way to import multiple classes from namespace in a single declaration ?!
- What is the resulting output of this for statement?
- Which PHP script finds the earliest and latest dates from an array?
- Which script might be used to continue a user’s search for music, across different webpages?
- Imagine a web application, built following a MVC architecture, that contains a quiz and a button to score it, When the user presses the Score button, which component should handle the request?
- A PHP “variable variable” takes the value of a variable and treats that as the name of a variable. For example, if $var is a variable then $$var is a variable variable whose name is the value of $var. Which script produces the output below, using variable variables?
- When should this php script be used?
- What below script will print?
- Which is not a valid magic constant?
- Why is it not recommended to make all of a class’s variables public?
- Which two functions can sanitize text and validate text formats?
- What is the correct way to include the file gravy.php in the middle of HTML code?
- What are some of the main types of errors in PHP?
- Your site must allow uploading of large files. What might you need to do?
- Which code will return the IP address of the client?
- DRY (Don’t Repeat Yourself) is a principle of software development aimed at reducing repetition of software patterns. Which choice is not a way to write DRYer code with PHP?
- Describe what happens if you run this code in a testing environment:
- Which superglobal variable holds information about headers, paths, and script locations?
- What type of computer language is PHP?
- Which is not true of the toString() in PHP?
- Is the output of this code in descending order, shown vertically, and with spaces between numbers? And what is the output?
- Which function can you use in error handling to stop the execution of a script and is equivalent to exit()?
- Which are types of control structures in PHP?
- Which loop displays all numbers from 1 to 10 inclusive?
- You want to find out what day Twelfth Night falls on after Christmas 2018. Which code should you use?
- Assume that $r is 255, and $g and $b are both 0. What is the correct code to output “#ff0000”?
- Create an associative array using $array1 as the keys and $array2 as the values:
- You want to use wildcard characters when searching for records in a MySQL/MariaDB database using a PDO prepared statement. Which code should you use?