Millet 2019 PHP parsing engineers face questions and answers

First, multiple choice (a total of 29 questions, each question 5 minutes)

1.PHP object-oriented approach rewrite the description of the error is?

A, subclass must inherit the parent class

B, subclass can override existing methods parent

C, after rewriting the sub-class will call the parent class method

D, sub-class may have attributes with the same name as the parent class, attribute coverage

Reference answer: C

Answer Analysis: subclass the parent class will not call again after rewriting, but a method that calls itself directly.

 

2.php option / function information is wrong role?

A, phpinfo () output information on the configuration of PHP

B, php_sapi_name () Returns the type of interface between the web server and PHP

C, ini_set () is a configuration option setting value

D, ini_get () Gets all configuration options

Reference answer: D

Answer Analysis: ini \ _get () is to obtain a configuration option, access to all configuration options function is ini \ _get \ _all ().

(Join the group 677 079 770 for more answers to interview questions.)

 

3. The following statement is wrong:

A, the list is divided into unidirectional list, doubly linked, circular list

B, last-out stack

C, FIFO queue, may be inserted from the head

D, FIFO queue

Reference answer: C

Answer Analysis: After the list is divided into one-way linked list, doubly linked lists, circular linked list stack advanced out of the FIFO queue.

 

4. traversal of the array, the following error is?

A、foreach

B、each

C、for

D、list

Reference answer: D

Answer Analysis: list only the elements of the array into a variable, not a traversal.

Joint use list (), each () and while loops through the array

each () function requires a pass array as a parameter and returns the current element in the array key / value pairs, and after moving the pointer to the location of the next array element.

list () function, this is not a real function, is a language construct PHP. list () for a set of variables assigned to a single operation.

 

 

 

5. Which of the following methods can not set the PHP maximum execution time of 120 seconds?

A, modify the configuration file php php.ini file, max_executin_time = 120;

B、$max_execution_time = 120

C、ini_set("max_execution_time", "120");

D、set_time_limit(120);

Answers: B

Answer Analysis: The first way need to restart the server, the third a direct function of the fourth set in the script, and the second is just an ordinary variable, regardless of use.

 

6. regular in \ w What is the meaning?

And, [0-9a-z]

B [0-9a-zA-Z]

C. [0-9a-zA-Z_]

D [0-9a-zA-Z _- \]

Reference answer: C

Answer Analysis: \ w matches the character numbers and underscores.

 

7.Java library, the class information is written to memory ().

A、 java.io.FileOutputStream

B、 java.io.ByteArrayOutputStream

C、 java.io.BufferedOutputStream

D、 java.io.DataOutputStream

Answers: B

Answer Analysis: No.

(Join the group 677 079 770 for more answers to interview questions.)

 

8. The following PHP code to run right result?

 

 

 

A、Array ( [val1] => Array ( [0] => 1 [1] => 2 ) [val2] => 3 [val3] => Array ( [0] => 4 [1] => 5 ) )

B、array(2) { [0]=> int(4) [1]=> int(5) }

C、array(2) { [0]=> int(1) [1]=> int(2) }

D、null

Answers: B

Answer Analysis:

The array_merge () or a plurality of the cell array combined, an array of values ​​attached behind the front of an array. Returns an array as a result of

 

10. The role of php function pointers, to say wrong?

A, current () Returns the current cell in an array

B, end () internal array pointer pointing to a last cell

C, reset () the internal pointer to the first element of the array

D, prev () internal array pointer moves forward a

Reference answer: D

Answer Analysis: prev () is a pointer to an array of internal Rewind.

 

11. Which of the following regular expression used to verify the mail (eg: [email protected]) format most correct ()

A, [_ \. 0-9a-z] @ ([0-9a-z] + \.) + [0-9a-z \ .-] {2,6}

B, [_ \. 0 ~ 9a ~ z -] * @ ([0 ~ 9a ~ z -] + \.) + [0 ~ 9a ~ z \.] +

C. [_ \. 0-9a-z -] @ + ([0-9a-z -] + \.) + [0-9a-z \.] +

D, [_ \. 0 ~ 9a ~ z -] + @ ([0 ~ 9a ~ z -] + \.) + [0 ~ 9a ~ z] {2,6}

Reference answer: C

Answer Analysis: C

 

 

 

12.PHP object-oriented inheritance features describing the error is?

A, Class extends keyword, so that subclasses inherit the parent class

B, subclass inherits only non-proprietary property of the parent class

C, the class inherits the parent class, the attributes corresponding to the parent class and subclass may be used to copy directly $ this call

D, PHP supports only single inheritance is not supported by a class inherits multiple classes and multiple inheritance

Reference answer: D

Answer Analysis: PHP is single inheritance can only inherit a class, but can be multi-layered inheritance.

(Join the group 677 079 770 for more answers to interview questions and learning materials.)

 

13. Which of the following operating modes no longer support PHP after PHP5.3?

A、CGI

B、FASTCIG

C, COUNT

D、CLI

Reference answer: C

Answer Analysis: After PHP5.3, PHP is no longer ISAPI mode, after installation no longer have php5isapi.dll this document. To use the IIS6 high version of PHP, you must install the FastCGI extension, then the IIS6 support FastCGI.

 

14. Why InnoDB table would suggest using an auto-increment a primary key?

A, using an auto-increment (INT / BIGINT type) as a primary key, which is the time increment the write sequence, and B + the number of leaf nodes sequentially consistent split

B, no

C, the table is not an auto-increment primary key is specified, and also can be selected not unique index (above conditions) the primary key, which when selected will InnoDB built ROWID as the primary key, and writing sequence consistent order growth ROWID

D, using an auto-increment (INT / BIGINT type) as a primary key, which is sequentially written from the time of increasing, the number of leaf nodes B + and split in the same order; auto-increment is not specified in the table as a primary key, but also can not be selected unique index (above conditions) the primary key, which when selected will InnoDB built ROWID as the primary key, and write-order consistency ROWID growth sequence; except, if InnoDB table and does not show a primary key, there may be selected unique primary key index, but that may not be unique index increasing relationship (e.g. a character string, the UUID, a multi-joint unique index field), the table access efficiency will be relatively poor

Reference answer: D

Answer Analysis: 1.InnoDB engine table is based on index-organized tables B + tree (IOT); 2. Each table needs to have a clustered index (clustered index); 3. all the rows are stored in the leaf nodes of B + tree (leaf pages of the tree); 4. clustered index based add, delete, change, the relative efficiency is the highest; 5. If we define the primary key (pRIMARY kEY), then it will choose as InnoDB clustered index; 6 If the primary key is not explicitly defined, the first InnoDB selects a unique index does not contain a NULL value as the primary key index; 7. If there is no such unique index, the built selects InnoDB 6 bytes long as an implicit ROWID containing a clustered index (writing rows ROWID as the primary key of the record is incremented, that unlike the ORACLE ROWID ROWID may be cited as implicit). Thus: 1. Since additional (INT / BIGINT type) as a primary key, which is sequentially written from the time of increasing, the number of leaf nodes B + and split in the same order; 2. This table does not specify an auto-increment primary key is also It can not be selected as the primary key unique index (above conditions), which will be selected when the built-in InnoDB ROWID as the primary key, and writes the sequence in the same order ROWID growth; InnoDB table 3. If a primary display and no key, there may be selects a unique primary key index, but that may not be unique index increasing relationship (e.g. a character string, the UUID, a multi-joint unique index field), the table access efficiency will be relatively poor.

 

The main entrance script 15. Which is not yii?

A, define the global constants

B, comprising [[Yii]] class files

C, load the application configuration

D, loading filter

Reference answer: D

Answer Analysis: Main entrance document as follows: defining global constants; registration Composer autoloader; includes
\ [Yii
\ [Yii
\] types of documents; loading the application configuration; creates an application instance and configure; call
\ [yiibaseApplication :: run ( )
\ [yiibaseApplication :: RUN ()
\] to process the request.

 

16. The same stacks and queues ()

A, abstract data types

B, the logical structure

C, storage structure

D, operations

Answers: B

Answer Analysis: linear form, the stack, the logical structure of the queue is the same, belongs to a linear structure. But they operate on different data, which show different characteristics.

17. The results in the following code $ third is how much?

 

 

 

A、array(1,2,3,4)

B、array(1,2)

C、array(3,4)

D, none of the above

Answers: B

Answer Analysis: The array_merge two arrays () with the addition of two arrays of different: If the key is a string: $ arr1 = array ( "a" => "AAA"); $ arr2 = array ( "a" => "BBB"); $ arr3 = array_merge ($ arr1, $ arr2); // BBB $ arr4 = $ arr1 + $ arr2; // AAA / * If the key is a string of two arrays and the same, array_merge () operation , the value of the array will cover the front of the array if the value of the key is a string of two arrays and the same, two arrays together, the value before the array after the array coverage value * / if key integer : $ arr1 = array ( "AAA"); $ arr2 = array ( "BBB"); $ arr3 = array_merge ($ arr1, $ arr2); // Array ([0] => AAA [1] => BBB) $ arr4 = $ arr1 + $ arr2; // AAA / * If the key array is two and the same number, the array_merge () operation, the values ​​of the two arrays do not exist if the key cover two numbers and the same array of two summing array, the value of the array will cover the front of the array * /

 

18. The regular expression, the match represents the character is non-numeric characters ()?

A、\b

B、\d

C、\B

D、\D

Reference answer: D

 

18. The regular expression, the match represents the character is non-numeric characters ()?

A、\b

B、\d

C、\B

D、\D

Reference answer: D

Answer Analysis:

Metacharacters

description

\

The next character tag, or a backward reference, or an octal escape. For example, "\\ n" match \ n. "\ N" matches a newline character. Sequence "\\" matches "\" and "\ (" the match "(". That is equivalent to the concept of multiple programming languages ​​have "escape character" of.

^

Matches the beginning of the string. If the object is set RegExp Multiline property, ^ also matches the position after "\ n" or "\ r".

$

Matches the input end of the string. If the object is set RegExp Multiline property, $ also matches the position before the "\ n" or "\ r".

*

Matches any number of times in front of the sub-expression. For example, zo * matches "z", can match "zo" and "zoo". * Equivalent to o {0,}

+

Preceding subexpression matches one or more (not less than 1). For example, "zo +" matches "zo" and "zoo", but can not match the "z". + Is equivalent to {1}.

?

Matches the preceding subexpression zero or one. For example, "do (es)?" Matches "do" or "does" in the "do". ? Is equivalent to {0,1}.

{n}

n is a nonnegative integer. Matching the determined n times. For example, "o {2}" does not match "Bob" in the "o", but can match the "food" in the two o.

{n,}

n is a nonnegative integer. Matching at least n times. For example, "o {2,}" does not match "Bob" in the "o", but it can match all o "foooood" in. "O {1,}" is equivalent to "o +". "O {0,}" is equivalent to "o *".

{n,m}

m and n are non-negative integers, wherein n

?

When the character immediately to any other qualifier (*, +,?, {N}, {n,}, {n, m}) when the rear, non-greedy matching pattern. Non-greedy pattern matches as little as possible the search string, and the default greedy pattern matches as much of the string search. For example, the string "oooo", "o +" will match as many "o", the result obtained [ "oooo"], and "o +?" As little as possible to match "o", the result obtained [ 'o ',' o ',' o ',' o ']

.point

Match any single character except "\ r \ n" is. To match including "\ r \ n", including any character, use as "[\ s \ S]" mode.

(pattern)

Match the pattern and get the match. The matching can be obtained from the Matches have been used in collection SubMatches VBScript, JScript is used in the $ 0 ... $ 9 properties. To match parentheses characters, use "" or "" or "."

(?:pattern)

Non-access match, but not to acquire matching pattern matching results, not stored for later use. This is in use or character "(|)" is useful when combined parts of a model. For example, "industr (:? Y | ies)" is a more than | more brief expressions "industry industries".

(?=pattern)

Non-matching, positive affirmation pre-investigation, matching the search string at the beginning of the string any pattern matching, the match does not need to obtain for later use. For example, "Windows (= 95 |? 98 | NT | 2000)" can match "Windows2000" in the "Windows", but can not match "Windows3.1" in the "Windows". Pre-check does not consume characters, that is, after a match occurs, the last match after the next match to start the search immediately, rather than starting from the characters that contains pre-investigation.

(?!pattern)

Non-matching, positive negative pre-investigation, matching the search string at the beginning of the pattern does not match any of the string, the match does not need to obtain for later use. For example, "Windows (95 |?! 98 | NT | 2000)" can match "Windows3.1" in the "Windows", but can not match the "Windows2000" in the "Windows".

(?

Non-access match, the reverse is certainly pre-investigation, and certainly pre-investigation forward similar, but in the opposite direction. E.g,"(?

(?

Non-matching, reverse negative pre-investigation, with negative pre-investigation forward similar, but in the opposite direction. E.g"(?

Here can not use any one or more than two, such as "(?

x | and

Match x or y. For example, "z | food" can match the "z" or "food" (caution here). "[Zf] ood" matching the "zood" or "food".

[xyz]

Set of characters. Matches any character included. For example, "[abc]" matches "plain" in "a".

[^xyz]

Negative character sets. Matches any character not included. For example, "[^ abc]" matches "plain" in "plin".

[a-z]

Range of characters. Matches any character within the specified range. For example, "[az]" matches "a" to any of the lowercase alphabetic characters "z" range.

Note: Only the hyphen in the character set of internal and occurs between two characters to represent a range of characters; if the beginning of the character set, you can only represent a hyphen itself.

[^a-z]

Negative character range. Matches any character not in any specified range. For example, "[^ az]" may not match any "a" to any character "z" range.

\b

Matches a word boundary, that is, refers to the location and the space between words (ie, the regular expression "matches" There are two concepts, one is matching characters, one is matching position, where \ b is matched positions). For example, "er \ b" matches "never" in the "er", but does not match the "verb" in "er".

\B

Matching non-word boundary. "Er \ B" matches "verb" in "er", but can not match "never" in "er".

\cx

Match control characters specified by the x. For example, \ cM matches a Control-M or carriage return. The value of x must be AZ or az. Otherwise, c as a literal "c" character.

\d

Matches a digit character. Equivalent to [0-9]. grep to add -P, perl regular support

\D

Matching a non-numeric characters. It is equivalent to [^ 0-9]. grep to add -P, perl regular support

\f

Match a feed character. Equivalent to \ x0c and \ cL.

\n

Matches a newline. Equivalent to \ x0a and \ cJ.

\r

Matching a carriage return. Equivalent to \ x0d and \ cM.

\s

Matches any non-visible characters, including spaces, tabs, page breaks, and so on. Is equivalent to [\ f \ n \ r \ t \ v].

\S

Matches any visible characters. Is equivalent to [^ \ f \ n \ r \ t \ v].

\t

A matching tab. Equivalent to \ x09 and \ cI.

\ v

Matching a vertical tab. Equivalent to \ x0b and \ cK.

\w

Matches any word character including underscore. Similar but not equivalent to the "[A-Za-z0-9_]", where "word" characters from the Unicode character set.

\W

Matches any non-word character. It is equivalent to "[^ A-Za-z0-9_]".

19. The result is the following code output?

 

A、1

B、2

C、3

D、4

Answers: A

Answer Analysis: if ($ str == 0), the string, and a digital comparator are equal, corresponding to the string $ str implicitly converted to digital, and then comparison, equivalent if (intval ($ str) == 0) . if ($ str == 0) is determined, and if (intval ($ str) == 0) are equivalent, while, and if ($ str) is not the same. IF ($ str) based $ str values ​​are not initialized. There is no value to pay, as long as the value of pay, it returns true. Of course you can also use $ str = "String"; if ($ str === 0) {echo "returns true.";}, Is to determine the data type and value $ str and values ​​are the same as the data type 0 before it can return true.

 

20.fopen () which does not support the Open?

A、c

B、z

C、x

D、a

Answers: B

Answer Analysis: fopen () support "r, r +, w, w +, a, a +, x, x +, c, c +" 10 ways.

 

21. Which of the following advantage is not a relational database?

A, to maintain data consistency

B, because the standards-premise data update overhead small

C, can join other complex queries

D, easy to expand, add a new server soon

Reference answer: D

Answer Analysis: Relational database extensions when more trouble. The answer to D

(Join the group 677 079 770 for more answers to interview questions.)

22. The following block output is?

echo 24%(-5);

A、5

B、4

C、-4

D、19

Answers: B

Answer Analysis: In PHP, the modulus operator per cent of the dividend and the sign (sign) the same. That same $ a% $ b $ a result and a symbol. Thus 24% (- 5), the sign is positive, the result is 4.

 

23. The information system is large and information technology () support a large system having a large scale, broad distribution, a multi-level network architecture, wherein a variety of types of applications.

A, Communication Technology

B, Security Technology

C, data processing techniques

D, virtualization technology

Answers: A

Answer Analysis: Information Systems Project Management Professional Course Third Edition P113,1.9.1 large-scale information systems: large-scale information systems refers to the information technology and communications technology to support large-scale, distributed broad, multi-level network architecture, spanning multiple secure domain, process massive, complex and forms of data, the system offers a large variety of types of applications.

 

24. a bank to provide users with the online service that allows users to manage their own browser bank account information. To protect the security of communications, the Web server is optional protocol ().

A、POP

B、SNMP 

C、HTTP

D、HTTPS

Reference answer: D

Answer Analysis: common sense.

 

25.mysql5.7 concerning json description of the type, that is not right

A, JSON data can be done to check the validity of

B, json data, still need to traverse all strings to find data

C, JSON makes query performance upgrade

D, JSON supports part attribute index, the index can be part of the data in JSON virtual function column

Answers: B

Answer Analysis: native JSON advantages are as follows: 1. similar text storage, you can store very large data. 2. JSON validity check: insert data must be JSON string type of job. 3. Compared to traditional forms, through all the strings do not need to find data. 4. Support Index: JSON data may be indexed by a virtual column portion functions.

 

26 The following PHP module operation mode is the mode?

A、cgi

B、cli

C、apache2handler

D、fast-cgi

Reference answer: C

Answer Analysis: apache2handler is a module mode

 

27. want to match the numeric string "abc 123" in, which the regular expression is correct?

A、/\d*/

B、/[0-9]*/

C、/[^a-z]*/

D、/\d+/

Reference answer: D

Answer Analysis: The numbers match, \ d + represents at least one digital configuration, A and B are not at least this meaning, C that is not a number.

 

28. Although Linux system has no concept of file extensions, but we usually think of () at the end of the file is a shell script

A exe

B、doc

C、sh

D, py

Reference answer: C

Answer Analysis: linux transport Wiki this specification, non-essential.

 

29.php mode of operation that does not include the following?

A、IaSApi

B、fast-cgi

C、cli

D、apache2handler

Answers: A

Answer Analysis: isapi should be api interfaces provided by Microsoft for internet services.

 

Second, multiple-choice questions (questions of 1 per 5 points)

1. How to make PHP website run faster?

A, compressed code, removing unwanted white or annotations

B, to make use of built-in functions or PHP extension function

C, with apc / xcache / opcache like opcode cache of PHP

D, the server configuration parameters to adjust the maximum FastCGI

Answer: A, B, C

Answer Analysis: D error, you should configure the appropriate parameters based resources for FastCGI, rather than blindly to maximum performance

 

Share content limit from time to time :( join the group 677 079 770 for more answers to interview questions and learning materials.)

 ★ Tencent Senior PHP Engineer written questions 

 ★ one hundred million PV high concurrency scenarios order handling 

 ★ laravel development Lynx mall Component Services 

 ★ banners TV video broadcast infrastructure project combat 

 

 

 

 

 

  



Guess you like

Origin www.cnblogs.com/993089249a/p/11613044.html