Two-stage test error and Reflection (Database + object-oriented)----2017-04-24

Source: Internet
Author: User

First, the cause of the error:

1, basic concepts, the basic knowledge is not firmly held

2. Carelessness

Second, the wrong question

11. The following statements are correct: (A)

A. The subscript of an array must be a number and start with "0"

B. The subscript of an array can be a string

C. element types in arrays must conform to PHP F strong type language T

D. The subscript of the array must be a continuous PHP F-strong type language T

parsing: The correct answer b;acd is wrong in PHP, and is correct in a strongly typed language.

13. The statement about exit () and Die () is correct (B)

A, when exit () function execution will stop executing the following script, and die () cannot do F

B, when the Die () function execution will stop executing the following script, and exit () cannot do F

C, where the Die () function is used, you can also use the exit () function to replace

No difference between D, die () function and exit () function

parsing: The correct answer to the C;die () function and the exit () function are for the program to exit; You can give the argument, the argument is a string type, and after executing this function, the following code is no longer executed. D is also correct.

14, the following program operation results (D)

<?php
$nextWeek = time () + (7 * 24 * 60 * 60);
Echo ' Now: '. Date (' y-m-d '). " \ n ";
Echo ' Next Week: '. Date (' y-m-d ', $nextWeek). " \ n ";
?>

A, get today's date (month-day)

B, get today's date (year-month-day) with next week's date (year-month-day)

C, get the current time (hours-minutes-seconds)

D, get the time between now and next week

Parse: correct answer B.

15. The following code executes the result: (C)

<?php

function Print_a () {

$A = "Phpchina";

echo "A value is:" $A. " <p> ";

return ($A);

}

$B = Print_a (); //No return value

echo "B value is:" $B. " <P> ";

?>

A A value is:

The B value is:

B a value is:

The B value is: Phpchina

C A value is: Phpchina

The B value is: Phpchina

D A value is: Phpchina

The B value is:

Parse: correct answer D.

16. The following code executes the result: (D)

<?php

$A = "Hello";

function Print_a ()

{

$A = "php mysql!!";

Global $A; //Use variable A as a global variable; From here, the value of a is the value of the outer part of the function

Echo $A;

}

Echo $A;

Print_a ();

?>

A Hello

B php mysql!!

C Hello Hello

D Hello php mysql!!

Parse: correct answer c. Under normal circumstances, variables defined outside the function are not accessible to the function, and if set to a global variable, the outside variables can be accessed;

If the

$A = "php mysql!!";

Global $A;

Into

Global $A; A for here is Hello

$A = "php mysql!!"; Here's a has been re-assigned to PHP MySQL!!

Then select D

24, PHP How to output backslash (B)

A \ n B. \ r C. \ t D. \\

Parse: correct answer D. AB is carriage return, C is a tab escape character

29. The following defines the function in the correct way (A)

a:public void Show () {} strongly typed language

B:function Show ($a =5, $b) {}

C:function Show (A, b) {}

D:function Show (int $a) {} no variable type in PHP

Resolution: correct answer b

30. Which of the following options does not add John to the users array? A

A. $users [] = "John";

B. Array_add ($users, "John");

C. Array_push ($users, "John");

D. $users ["AA"]= "John";

Parse: the correct answer b; ac all appends the element at the end of the array. Careless

38. The following statement is correct (B)

A: $attr represents an array, then the length of the array can be obtained by $attr.length JS to Count

the B:unset () method cannot delete an element inside an array that can be confused with a delete variable when you do a problem

An array of c:php can store any type of data

d:php only indexed arrays

Resolution: correct answer C;

Third, the problem of attention

1. What is lamp? (Forgotten during the exam)

Linux

Linux is free open source software, which means that the source code is available for the operating system.

Apache

Apache is one of the most popular open source web server software in use.

Mysql

MySQL is multi-threaded, multi-user SQL database management system.

MySQL has been purchased by Oracle from January 27, 2010 through Sun. SUN originally acquired MySQL on February 26, 2008.

Php,perl or Python

PHP is a programming language originally designed to produce dynamic Web sites. PHP is primarily used for server-side application software. Perl and Python are similar.

10. The functions that should be used at the following horizontal lines are: (B)

<?php

$email = ' [email protected] ';

$str = ____ ($email, ' @ ');

$info = ____ ('. ', $str);

____ ($info);

?>

The output is:

Array ([0] = @thizlinux [1]=>com[2]=>cn) no output type, excluding ad

A:strchr,split, Var_dump

B:strstr, Explode, print_r

C:strstr,explode, Echo

D:STRCHR, Split, Var_dump

Resolution: STRCHR () will be the front of the cut, leaving behind;

20, 404 error when viewing Web page in Browser The reason is (the file does not exist/access address error) Common sense

26.

A:echo "Hello\nworld", in the page can implement line break error because \ n in the source code can implement line break, not in the Web page, need to use </br>/<p></p>

D:print $a, "hello"; can output data without error print output one at a time

35.

B: There is no difference between the constructor and the normal function. The constructor is special;

36. The following statements about polymorphism are correct (D)

A: Polymorphism occurs when each object invokes a method that satisfies the condition
B: Polymorphism is caused by the definition of different functions within subclasses.

C: polymorphic generation does not require conditions

D: When the parent class refers to a subclass instance, because the child class overrides the method of the parent class, the differences that appear when the parent class refers to the corresponding function are called polymorphic.

39.

D:mysql If the Install only service (NAVICAT) does not install the interface (MySQL) can also be used properly

Reflection: Not thorough comprehension, carelessness in doing a problem, incoherent knowledge .....

Two-stage test error and Reflection (Database + object-oriented)----2017-04-24

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.