1. Trang chủ
  2. » Công Nghệ Thông Tin

Zend PHP Certification Study Guide- P12

20 274 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Getting Ready for the Certification Exam
Thể loại Study Guide
Năm xuất bản 2004
Định dạng
Số trang 20
Dung lượng 216,04 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

The certification test consists of four different question types: single choice, multiple choice, fill in the blanks, and open questions.. Perl Hypertext Preprocessor Figure 13.1 shows a

Trang 1

204 Chapter 13 Getting Ready for the Certification Exam

Zend may, at its sole discretion, designate a logo for limited use by those individuals who have passed this exam (the “Logo”).The Logo is personal and may only be used

by you and no other person or entity.You may use the Logo only on your personal business cards, letterhead, personal website, and your resume and not in any other form.You are prohibited from displaying or using the Logo in any way that may imply that you are an employee or otherwise related to, or endorsed by, Zend.The Logo only relates to that level of certification that you have achieved.You may not modify or otherwise alter or change the Logo In the event your certification expires

or is otherwise terminated, you will immediately cease use of the Logo

Viewing Backward and Forward

During the exam, the examinee may page back and forward at any time Even after the completion of the entire exam, you may go back to review, change, and edit answers Once the End Exam button has been pressed, the exam is processed and no changes can

be made

Reviewing Your Answers

If you are unsure about a certain question during the test or would like to remind your-self to come back to a question at the end of the test, you may use the Review feature This is a recommended and time-saving feature It appears as a review check box on the upper left-hand corner of the exam delivery application Checking this box will mark the question for review, and at the end of the exam, a summary of all the questions marked by you will be displayed with the option to go back and iterate through only those questions

Your Comments

Examinees are able to leave comments throughout the duration of the exam by either clicking the comment button at the bottom of the screen or pressing ALT+M, which opens a comment window It is suggested that you only leave comments after you have completed all the questions No extra time will be added to the exam for the time taken

to write comments

What Kinds of Questions Are Asked?

The certification test consists of four different question types: single choice, multiple choice, fill in the blanks, and open questions

Single Choice Questions

Trang 2

single answer from a given selection of between two and six answers.There is only one correct answer for these types of questions and only one answer can be marked.You will normally notice answers that might seem correct but because of some small detail, they are not Pay attention to exactly what is being asked!

An example of a single choice question is What does PHP stand for?

A People Helping People

B PHP Hypertext Preprocessor

C PHP Hypertext Preprocessing

D Perl Hypertext Preprocessor Figure 13.1 shows an example of how a single choice question would appear in an exam

Figure 13.1 A single choice question.

Multiple Choice Questions

Constructed similar to single choice questions though with one major difference; the multiple choice questions have between two and four correct answers.The examinee is notified of the number of correct answers that should be checked.This tip might not

Trang 3

206 Chapter 13 Getting Ready for the Certification Exam

An example of a multiple choice question is Which of the following are directives in the php.inifile? (Choose three.)

A session.save_handler

B asp_tags

C output_buffering

D flush

Figure 13.2 shows an example of how a multiple choice question would appear in an exam

Figure 13.2 A multiple choice question.

Fill in the Blanks Questions

The examinee is provided with one or more sentences that have had parts extracted and replaced with underscores.The examinee then chooses the most appropriate set of extractions that, when placed back in to the sentence, make it correct.There is only one correct answer for this type of question

Trang 4

An example fill in the blank question is PHP is a general purpose _ language that is mostly used for _ and can be embedded in _

A Web,Web development, web pages

B scripting,Web development, HTML

C scripting, server-side development, JavaScript

D procedural,Web development, HTML

Open Questions

An open question is probably the most difficult question type where the examinee is requested to give text answers to the question.There are no choices here but just a text box for the answer.The majority of these questions will request a PHP function name (do not include the parentheses in the answer), where others might request the output of

a code snippet or other PHP keywords

An example open question is What function in PHP is used to display an HTML output of the PHP configura-tion and setup?

Answer:

Figure 13.3 shows an example of how an open question would appear in an exam

Trang 6

Practice Exam Questions

1 Which of the following strings are not valid modes for the fopen()function?

A a+b

B b+a

C at

D w

E x+

2 Consider the following piece of code:

<?php

$arr = array(3 => “First”, 2=>“Second“, 1=>“Third“);

list (, $result) = $arr;

?>

After running it, the value of $resultwould be

A First

B Second

C Third

D This piece of code will not run, but fail with a parse error

3 In standard SQL-92, which of these situations do not require or cannot be handled through the use of an aggregate SQL function? (Choose 2)

A Calculating the sum of all the values in a column

B Determining the minimum value in a result set

C Grouping the results of a query by one or more fields

D Calculating the sum of all values in a column and retrieving all the values of another column that is not part of an aggregate function or GROUP BYclause

E Determining the mean average of a column in a group of rows

4 Multidimensional arrays can be sorted using the function

Trang 7

210 Practice Exam Questions

5 When using the default session handler filesfor using sessions, PHP stores session information on the harddrive of the webserver.When are those session files cleaned up?

A PHP will delete the associated session file when session_destroy()is called from within a script

B When the function session_cleanup()is called, PHP will iterate over all session files, and delete them if they exceeded the session timeout limit

C When the function session_start()is called, PHP will iterate over all session files, and delete them if they exceeded the session timeout limit

D When the function session_start()is called, PHP will sometimes iterate over all session files, and delete them if they exceeded the session timeout limit

E Session files are never removed from the filesystem, you need to use an auto-mated script (such as a cronjob) to do this

6 What is the order of parameters in the mail()function?

A subject, to address, extra headers, body

B to address, subject, extra headers, body

C to address, subject, body, extra headers

D subject, to address, body, extra headers

7 Which of the following statements are correct? (Choose 3)

A sprintf()does not output the generated string

B printf(“%2s%1s“, “ab“, “c“)outputs the string abc

C vprintf()takes at least one parameter; the first parameter is the formatting string and the following parameters are the arguments for the ‘%

placeholders

D printf(“%c“, “64“)will output @and not 6

E sprintf(“%3.4f“, $x)outputs more than 7 characters

F number_format()inserts thousands of separators and decimal points differ-ent from (,) and (.) respectively, while printf()like functions always use (.) as decimal point

Trang 8

8 The requirement is to return truefor the case in which a string $strcontains another string $substrafter the first character of $str? Which of the following will return truewhen string $strcontains string $substr, but only after the first character of $str?

I

<?php

function test($str, $substr) {

return strpos(substr($str,1), $substr) >= 0;

\}

?>

II

<?php

function test($str, $substr) {

return strrchr($str, $substr) !== false;

\}

?>

III

<?php

function test($str, $substr) {

return strpos($str, $substr) > 0;

\}

?>

A I only

B II only

C III only

D I and II

E I and III

F II and III

9 Which of the features listed below do not exist in PHP4? (Choose 2)

A Exceptions

B Preprocessor instructions

C Control structures

D Classes and objects

E Constants

Trang 9

212 Practice Exam Questions

10 What is the output of the following code snippet?

<?php class Vehicle {

\}

class Car extends Vehicle {

\}

class Ferrari extends Car {

\}

var_dump(get_parent_class(“Ferrari”));

?>

A string(7) “Vehicle“

B string(3) “Car“

C array(2) {

[0]=>

string(7) “vehicle“

[1]=>

string(3) “car“

\}

11 The following PHP script is designed to subtract two indexed arrays of numbers Which statement is correct?

<?php

$a = array(5, 2, 2, 3);

$b = array(5, 8, 1, 5);

var_dump(subArrays($a, $b));

function subArrays($arr1,

$arr2) {

$c = count($arr1);

if ($c != count($arr2)) return

null;

Trang 10

for($i = 0;

$i < $c;

$i++)

$res[$i]

$arr1[$i] - $arr2[$i];

return $res;

\}

?>

A The script is valid

B Assignments must be made on a single line

C It has too many linefeed characters between statements

D No, the script is missing curly braces

E Yes it is valid, but the script will not work as expected

12 What is the purpose of the escapeshellarg()function?

A Removing malicious characters

B Escaping malicious characters

C Creating an array of arguments for a shell command

D Preparing data to be used as a single argument in a shell command

E None of the above

13 The _ function can be used to determine if the contents of a string can

be interpreted as a number

14 Assume $commentcontains a string.Which PHP statement prints out the first 20 characters of $commentfollowed by three dots (.)?

A print substr($comment, 20) ‘ ‘;

B print substr_replace($comment, ‘ ‘, 20);

C print substr($comment, 20, strlen($comment)) ‘ ‘;

D print substr_replace($comment, 20, ‘ ‘);

15 What is the name of the function that you should use to put uploaded files into a permanent location on your server?

16 If you have a file handle for an opened file, use the function to send all data remaining to be read from that file handle to the output buffer

Trang 11

214 Practice Exam Questions

17 Which of the following sentences are not true? (Choose 2)

A strpos()allows searching for a substring in another string

B strrpos()allows searching for a substring in another string

C strpos()and strrchr()return -1if the second parameter is not a sub-string of the first parameter

D strpos()and strrpos()can return a value that is different from an integer

E The second parameter to substr()is the length of the substring to extract

F strstr()returns falseif the substring specified by its second parameter is not found in the first parameter

18 Which of the following sentences are correct? (Choose 2)

A time() + 60*60*100returns the current date and time plus one hour

B time() + 24*60*60returns the current date and time plus one day

C time() + 24*60*60*100returns the current date and time plus one day

Answers

1 B

2 C

3 C and D

4 array_multisortor array_multisort()

5 D

6 C

7 A, D, and F

8 C

9 A and B

10 A

11 B

12 D

13 is_numericor is_numeric()

14 B

15 move_uploaded_fileor move_uploaded_file()

16 fpassthruor fpassthru()

Trang 12

Ad Hoc To improvise solely in response to a particular situation and/or problem without considering wider issues

Aggregate functions Special SQL functions that take the values from multi-ple rows of data to produce a single result per grouping Examples of aggregate functions include MIN(),MAX(),COUNT(),

SUM(), and AVG()

API (Application Programming Interface) A set of definitions by which a particular interface is accessed

The PHP API refers to the catalog of procedures and functions available for use from a userspace script

Associative Arrays An array indexed

by associative (or string) keys Array val-ues are referenced by their “associated”

key names

ASP Scripting environment provided

by Microsoft for its IIS (Internet Information Services) web server in which HTML is combined with script-ing and reusable ActiveX or NET com-ponents to create dynamic web pages

Array A collection of data items identi-fied by numeric and/or string indices

Arrays in PHP can also contain other arrays; an array that only contains other

Blocking and nonblocking calls A blocking call is one that will “block” fur-ther execution of your script until condi-tions permit it to successfully complete

or a predefined timeout occurs A non-blocking call, by contrast, will fail imme-diately if it is not capable of completing its operation

Boolean An expression or variable that has two possible values: “true” and “false.”

Bytecode A meta language used by the PHP compiler to represent your script internally Once your script has been converted to bytecode by the compiler, it will be passed to the executor to be run

Bytecode cache By default PHP will recompile your script into bytecode every time your page is requested whether the source code for your page has changed or not A bytecode cache will compile your scripts once and reuse the bytecode until your script changes

C A programming language originally designed by Dennis Ritchie at AT&T Bell Labs in 1972 for systems program-ming on the PDP-11 and soon after used

to re-implement UNIX It was dubbed

“C” because of the many features inher-ited from an earlier language named “B.”

Glossary

Trang 13

216 Class

Class A class definition is a prototype for an object in an object-oriented lan-guage defining member properties and methods for use within the class or object instantiation

Client side Any operation that occurs

on the client’s machine (usually within the context of a web browser).Typically, client-side operations are performed using JavaScript, Java Applets, Macromedia Flash, or ActiveX compo-nents Client-side operations do not have direct access to server-side processes such

as PHP

Clone Creates a copy of an object In most cases, this simply means copying property values from the original object

to the new object; however, cloning might require performing alteration or separation logic so that the new object does not create a resource conflict In PHP 4, objects are cloned by default In PHP 5, objects are implicitly referenced and only cloned by explicit request

Column Together with row defines

a specific unit of information with a database table All values within a given column describe the same type of infor-mation (that is, name, address, password, and so on) Columns are also referred to

as fields

Command Injection A form of exploit attack, similar to SQL Injection, used against scripts that do not adequately val-idate or filter user supplied data.When unfiltered and unvalidated data is passed

to a command-line function (exec(),

Constants Similar to a variable except that it exists outside of variable scooping and can only be defined once A con-stant’s value cannot be changed once it is defined

Cookie A parameter supplied by the web server to the browser that the browser is expected to send back to the web server on its next visit.They can be set from PHP using the set_cookie()

command and retrieved on next request

in the $_COOKIEsuperglobal

Cross-Site Scripting Also known as XSS, this is a form of exploit attack in which a malicious user supplies content

to be later displayed on your website (such as with a forum).This content is designed to fool other user’s browsers into sending sensitive information to an untrusted target See Chapter 11

Data Validation Scanning and some-times filtering user supplied data to limit provided information to sensible con-straints.This can be as simple as requiring

an age field that only contains numbers,

to as complex as ensuring that a URL is well formed and that the resource it refers to exists

Database A database is a generalized term for describing a logical grouping of data Usually the term database will be used to refer to an RDBMS or a specific schema within an RDBMS

Database indexing A database index enables your RDBMS to more quickly find data based on identifying fields For example, if you plan to allow searching

Ngày đăng: 24/10/2013, 12:15

TỪ KHÓA LIÊN QUAN