The latest summary of multiple choice questions for PHP interview questions

藏色散人
Release: 2023-04-09 20:58:02
forward
3865 people have browsed it

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.EmptyB.true C.false D.FALSE

echo function_exists('print');
Copy after login

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

2. Which is the function

A.array B.evalC.eachD.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';
Copy after login

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. ErrorD.hellohello

$a[bar] = 'hello'; echo $a[bar]; echo $a['bar'];
Copy after login

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'];
Copy after login

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!

Related labels:
php
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!