Prep ACTUAL QUESTIONS AND
CORRECT ANSWERS
Which function searches for a regular expression in a string and returns 1 if the pattern is
found? - CORRECT ANSWERS✅✅preg_match
What modifier can be added to the end of a regular expression in PHP to make it case
insensitive? - CORRECT ANSWERS✅✅i
A list of functions or methods in the reverse order in which they were called is
a(n)________________. - CORRECT ANSWERS✅✅stack trace
Regular expressions - CORRECT ANSWERS✅✅can be used to completely validate some
types of user entries
Which of the following are coded patterns that you can use to search for matching patterns in
text strings? - CORRECT ANSWERS✅✅regular expressions
Which of the following will match a new line in a PHP regular expression? - CORRECT
ANSWERS✅✅/n
This pattern can be used to validate a five-digit zip code: - CORRECT
ANSWERS✅✅/^\d{5}$/
Which character is used to signify the beginning or the end of a word in a PHP regular
expression? - CORRECT ANSWERS✅✅\b
If you want to code a catch block that catches all types of exceptions and gets the message
associated with the exception, you start the catch block like this: - CORRECT
ANSWERS✅✅catch (Exception $e) {
, Which of the following will match any character that is NOT a letter, number, or underscore
in a PHP regular expression? - CORRECT ANSWERS✅✅\W
All of the arguments that are passed to a function are available in an array that can be
accessed by using the - CORRECT ANSWERS✅✅func_get_args function
If you create a function that passes an argument by reference, the function - CORRECT
ANSWERS✅✅can change the original variable without using a return statement
Which of the following is a function that is passed as an argument to another function? -
CORRECT ANSWERS✅✅callback
Which of the following is a nested function that has access to the outer function's local
variables? - CORRECT ANSWERS✅✅closure
Which term describes locations in the code that have access to a variable? - CORRECT
ANSWERS✅✅scope
To avoid the duplication of function names, you can - CORRECT ANSWERS✅✅Use
namespaces
When creating functions, you can include ______________ that are located inside
parentheses after the function name. - CORRECT ANSWERS✅✅parameters
By default, all arguments passed to PHP functions are passed by ________________. -
CORRECT ANSWERS✅✅value
A variable declared inside a PHP function would be considered a ____________ variable. -
CORRECT ANSWERS✅✅local
Which method of passing a variable allows the function to change the value of the variable? -
CORRECT ANSWERS✅✅by reference