Home  >  Article  >  Backend Development  >  The latest summary of multiple choice questions for PHP interview questions

The latest summary of multiple choice questions for PHP interview questions

藏色散人
藏色散人forward
2021-04-09 11:29:123963browse

This article will share with you a new summary of multiple-choice PHP interview questions. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Related recommendations: "PHP interview questions, the latest summary of application questions""PHP interview questions, the latest summary of conceptual questions""PHP interview The latest summary of questions and answers

1. What is the output?

A.Empty B.true C.false D.FALSE

echo function_exists('print');

Analysis: Because print is a language structure, function_exists() returns false; echo false is empty.

2. Which is the function

A.array B.eval C.each D.list

Analysis: array, eval, and list are language structures, and each is a function.

3. Which function will be added below to return TRUE

A.ord(65) B.chr(65) C.65 '' D.'' 65

return ? == 'A';

Analysis: ord('A') is converted to a number, chr(65) is converted to a character.

4. The output result of the following code

A.hello B. Empty C. Error D.hellohello

$a[bar] = 'hello';
echo $a[bar];
echo $a['bar'];

Analysis: The subscript bar can be recognized without quotation marks, but it is recommended to add quotation marks.

5. What is the code that can get "banana"?

$arr = ['name'=>'banana'];

A.echo "{$res['name']}";

B.echo "$res['name' ]";

C.echo "{$res[name]}";

D.echo " $res[name]”;

Analysis: Within double quotes, if the array subscript is a string, single quotes cannot be added unless {} is added.

6. Which of the following errors cannot be caught by the standard error controller

A.E_WARNING

B.E_USER_ERROR

C.E_PARSE

D.E_NOTICE

Analysis:



E_ERROR Fatal runtime error. This type of error is generally an unrecoverable situation, such as a problem caused by memory allocation. The consequence is that the script terminates and does not continue to run.
E_WARNING Runtime warning. Only a prompt message is given, but the script does not terminate.
E_PARSE Compile-time syntax parsing error. Parsing errors are generated only by the parser.
E_NOTICE Runtime notification. Indicates that the script encounters a situation that may appear as an error, but there may also be similar notifications in scripts that can run normally.
E_USER_ERROR User-generated error message. Similar to E_ERROR, but generated by the user using the PHP function trigger_error() in the code.

8. Which of the following error types cannot be caught by a custom error handler?

A.E_WARNING

B.E_USER_ERROR

C.E_PARSE

D.E_NOTICE


This article was first published on the LearnKu.com website.

The above is the detailed content of The latest summary of multiple choice questions for PHP interview questions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete