Docstoc

Odesk

Document Sample
Odesk Powered By Docstoc
					                      Photoshoop exam test answer
Ø Changing units on the Info Palette automatically changes the units on Rulers.

TRUE

Ø Which of the following Filters cannot be applied to a Smart Object?

Pattern Maker

Ø With which of the given options does the Signal Strength Meter appear?

It appears when you choose ‘merge to hdr command’

Ø Channels can not be added to which of the following image modes?

Bitmap

Ø Which among the following Modes does not support layers?

All of the above

Ø Which of the following is not true about Filters?

None of the above

Ø Which of the following is not true about the Curves dialog box?

The Curves dialog box lets you adjust up to 14 different points throughout an image’s tonal
range

Ø Which of the following Slices is created with the Slice Tool?

User slices

Ø Which of the following features is supported by the EPS file format?

It supports the Grayscale and Bitmap color modes

Ø Which among the following blending modes is available only for the Apply Image and
Calculations commands?

Both a and b

Ø What is the use of the Make Work Path command in the Paths palette ?
It can alter the shape of a selection

Ø Which type of information is not displayed by the Info Palette?

It does not display the opacity of the current layer

Ø Which among the following is not a right option for selecting a web-safe color from the Color
Palette?

Choose Current Color from the Color Palette Menu

Ø Which keyboard shortcut (windows) will you choose to close a Path?

None of the above

Ø Anti-aliasing option is available for which of the given Tools?

All of the above

Ø Which of the following options displays the Spot Channels in the Channels palette?

B

Ø What happens when Use Legacy is selected as shown in the given picture?

It is used to apply proportionate (nonlinear) adjustments to image pixels

Ø Which option will you select to open the Levels dialog box?

Choose Image > Adjustments > Levels

Ø Which type of images are resolution-dependent?

Vector images

Ø Which Liquify Tool is used to reconstruct a part of a distorted image?

A

Ø In which Format will you save your file to preserve the Alpha channels?

All of the above

Ø Which of the following is not a kind of text type?

Line type
Ø Which option will you select to convert Types to Shapes?

Both b and c

Ø The mask created by the Replace Color command is permanent.

FALSE

Ø Which of the following Layer properties can be animated?

All of the above

Ø Which View will you choose to display a Histogram with no controls or statistics?

All of the above

Ø Which of the given options displays left indent in the Paragraph palette?

B

Ø Which keyboard shortcut (windows) will you choose to group Layers?

Control + G

Ø The Rotate Canvas command does not work on which of the following

All of the above

Ø Which of the Saving commands is available for an image that is managed by a Version Cue
Workspace?

Check In

Ø When will the Dynamic shortcuts appear in the Character Palette Menu as shown in the
picture?

All of the above

Ø Hanging Punctuation controls the alignment of the punctuation marks for a specific paragraph.

TRUE

Ø Which option will you choose to select all layers of a similar type?

All of the above
Ø Which of the following is not a Color Adjustment command?

Adjustment command

Ø By default, Masks applied to Smart objects are linked to Smart object layers. .

FALSE

Ø A working space is an intermediate color space used to define and edit color in Adobe
applications.

FALSE

Ø Which option will you select to remove the existing profile from the document in the given
image?

C

Ø You cannot change the order of the Vector masks or working paths in the Paths palette.

FALSE

Ø The Color Replacement Tool does not work in which of the following Image modes?

All of the above

Ø In which of the following Modes can you draw while working with the Shape or Pen tools?

All of the above

Ø The Out Of Gamut option works only on RGB and Lab images

TRUE

Ø Which among the following QuickTime Video formats is supported by Photoshop extended?

MOV
                                        Php 5 test
Question: given below is a small php script:

class person{
Function getSal()
{
…..
…..
…..
}
}
Class emp extends person{
funciton GetSal()
{
???
}
}
?>
The getSal() of emp has to behave exactly as getSal() of person .which of the folliwing lines of
code would you use to replce the

????
a. perent:: getSal();
b. person:: getSal();
c. parent:: getSal;
d. person:: getSal;

Ans: D
———————————————————————————————————————
————————————————————-
Question
what would be the output of the following code?
$stg=’good day’;
$stg= ucwords($stg);
echo $stg;
?>
a. good day
b. GOOD DAY
c. Good Day
d None of the above
Ans: C
———————————————————————————————————————
————————————————————-
Question:

which of the following command line interface constant is not defined in the cli sapi?

a. STDIN
b. STDOUT
c. STDPRT
d STDERR

Ans:C
———————————————————————————————————————
————————————————————-
Question:

if the session_cache_expire()is not set,then by default the session cache will expire after:

a. 1 hr
b. 2 hr
c. 3 hr
d 4 hr

Ans:C

———————————————————————————————————————
————————————————————-

Question:
Which of the following is not a correct way of commenting in php?
a. //php comment
b. /*php comment*/
c. #php comment
d /# php comment

Ans:D

———————————————————————————————————————
————————————————————-

Question:
What is true regarding this code?
a. setcookie will return false
b. setcookie will return true
c. setcookie will return null
d. Any of the above can happen
Ans: b
———————————————————————————————————————
————————————————————-
Question:
Which of the following is not a correct way of printing text in php5?
a. echo “Plain text”;
?>
b.
c.
d. <# echo “Plain text” #>
Ans :a

———————————————————————————————————————
————————————————————-
Question:
Which of the following is not the correct way of starting a session?

a. session.auto_start
b. session_register()
c. session_initiate()
d. session_start()
Ans: c;
———————————————————————————————————————
————————————————————-

Question:
Which of the following functions do you need to implement HTTP Basic Authentication?

a. authenticate ()
b. header ()
c. basic_auth ()
d. None of the above
Ans: d;

———————————————————————————————————————
————————————————————-
Question:
Which of the following Command Line Interface constant is not defined in the CLI SAPI?

a. STDIN
b. STDOUT
c. STDPRT
d. STDERR

Ans: c;
———————————————————————————————————————
————————————————————-
Question:
Which of the following statements is correct with regard to final and abstract?

a. An abstract class cannot have final methods
b. An abstract class cannot have non abstract methods
c. A final class cannot have abstract methods
d. A final class cannot have final methods

Ans:
———————————————————————————————————————
————————————————————-
Question:
Which composite data types are supported by php?

a. Array
b. Enumeration
c. List
d. Object
e. Integer

Ans: a

———————————————————————————————————————
————————————————————-
Question:
The default value of register_globals in PHP is:

a. Off
b. On

Ans: a

———————————————————————————————————————
————————————————————-
Question:
Which of the following is not a valid PHP connection status?

a. aborted
b. normal
c. open
d. timeout

Ans; c
———————————————————————————————————————
————————————————————-

Question:
Choose the correct statement:

a. include() includes and evaluates a specific file
b. require() includes and evaluates a specific file
c. include_once() includes and evaluates a specific file only if it has not been included before
d. require_once() includes and evaluates a specific file only if it has not been included before
e. All of the above

Ans: e
———————————————————————————————————————
————————————————————-
Question:
If the session_cache_expire() is not set, then by default the session cache will expire after:

a. 1 hr
b. 2 hrs
c. 3 hrs
d. 4 hrs

Ans: 3

———————————————————————————————————————
————————————————————-
Question:
What will be the output of the following script?

$count=50;
function Argument()
{
$count++;
echo $count;
}
Argument();
?>

a. It will print 50
b. It will print 51
c. It will print 52
d. It will print 1
Ans: d;
———————————————————————————————————————
————————————————————-

Question:
State whether True or False

Paamayim Nekudotayim operator allows access only to the static members of a class?

a. True
b. False

Ans: a
———————————————————————————————————————
————————————————————-
Question:
Which of the following statements is true with regard to comparisons in PHP5?

a. With “= =” operator, two object instances are equal if they have the same attributes and
values, and are instances of a different class.
b. With “==” operator two object instances are equal if they have the same attributes and values,
and are instances of the same class.
c. With (===) operator, object variables are identical if and only if they refer to the same instance
of the same class.
d. With (===) operator, object variables are identical if and only if they refer to the different
instance of the same class.

Ans: c;
———————————————————————————————————————
————————————————————-
Question:
You have to upload a file using form post method:

1
2 Send this file:
3
4

What should be the code in line 3, if the file name to upload is “SalesFile”?

a.
b.
c.
d.

Ans a;
———————————————————————————————————————
————————————————————-
Question:
Which of the following built-in function assist in checking if actually the function exists or not?

a. exists
b. function_exists
c. fexists
d. isFunction
Ans: b;
———————————————————————————————————————
————————————————————-
Question:
What will be the output of the following code?

$a = 0.0;

for ($i = 0; $i < a =”=”">

a. 0.9
Not Equals
b. 1
Equals
c. 1
Not Equals
d. 1.1
Not Equals
e. None of the above

Ans: c
———————————————————————————————————————
————————————————————-
Question:
What will be the output of the following code?

$i=4;
$j=30;
$k=0;
$k=$j++/$i++;
echo $i . ” ” . $j . ” ” . $k . ” “;

a. 5 31 6
b. 5 31 6.2
c. 5 31 7
d. 4 31 7.5
e. 5 31 7.5
Ans e;
———————————————————————————————————————
————————————————————-
Question:
Which of the following is a not a correct way of commenting in php?

a. //PHP Comment
b. /*PHP Comment*/
c. #PHP Comment
d. /#PHP Comment
Ans d;
———————————————————————————————————————
————————————————————-
Question:
Following is a php code block:

$m=9;
$n=99;
$z=8;
$z=$n++/$m++ + –$z;
echo $z;

what will be the output?

a. 16
b. 18
c. 19
d. 20
e. 17
Ans 18;
———————————————————————————————————————
————————————————————-

Question:
Which of the following is the correct way of specifying default value?

a. function GetDiscount($Type = “Special”) { . . . }
b. function GetDiscount(Type := “Special”) { . . . }
c. function GetDiscount($Type := “Special”) { . . . }
d. function GetDiscount($Type : “Special”) { . . . }

Ans a;

———————————————————————————————————————
————————————————————-
Question:
With reference to the following php script:

print ‘Text Line1′
print ‘Text Line2′
?>

What will be the output on running the script?

a. Text Line1Text Line2
b. Text Line1 Text Line2
c. ‘Text Line1′
d. ‘Text Line2′
e. Error message will be printed
Ans e;
———————————————————————————————————————
————————————————————-

Question:
What will be the ouput of the following code?

for ($i = 0; $i < i =”=”">

a. 0
1
2
3
4
5
b. 0
1
3
4
c. 2
d. 0
1
2
4
e. None of the above

Ans b;
———————————————————————————————————————
————————————————————-

Question:
Late PHP versions support remote file accessing for the functions:
a. include()
b. include_once()
c. require_once()
d. Both a and b
e. Both b and c

Ans e;

———————————————————————————————————————
————————————————————-
Question:
You have designed a user login form as follows:

User Name:

Password:

How can you access the username entered by the user in the ‘Validate.php’ webpage?

a. $var= $_POST['username'];
b. $var= $_REQUEST['username'];
c. import_request_variables(‘p’, ‘p_’);
$var= $p_username;
d. All of the above

Ans: d
———————————————————————————————————————
————————————————————-

Question:
Which of the following does not represent logical AND operator in PHP?

a. &
b. &&
c. And
d. AND

Ans: a
———————————————————————————————————————
————————————————————-

Question:
Which of the following is not true for a persistent connection?

a. These are not closed even after the execution of the script
b. These are mainly used to increase the efficiency of the system
c. These can’t be converted to non-persistent connections
d. These are preferably not used in the scripts involving transactions
Ans c;
———————————————————————————————————————
————————————————————-
Question:
Which of the following are invalid data types in PHP?

a. string
b. integer
c. float
d. char
e. array
f. object
Ans d
———————————————————————————————————————
————————————————————-

Question:
The Manager and Office classes are as follows:

class Manager{
function printName() {
echo “Manager”;
}
}
class Office{
function getManager() {
return new Manager();
}
}

$ofc = new Office();
???

?>

Which of the following should replace ‘???’ to obtain the value of printName() function?

a. $ofc->getManager()->printName();
b. new Office()->getManager()->printName();
c. $ofc->getManager->printName;
d. Office::getManager()::printName();
Ans a
———————————————————————————————————————
————————————————————-
Question:
The classes are defined as follows:
abstract class BaseCls{
protected abstract function getName();
}

class ChildCls extends BaseCls{

}

Which of the following implementations of getName() is invalid in ChildCls?

a. protected function getName(){}
b. function getName(){}
c. private function getName(){}
d. public function getName(){}

Answer d;

———————————————————————————————————————
————————————————————-
Question:
Which of the following variable declarations within a class is invalid in PHP5?

a. private $type = ‘moderate’;
b. var $term =3;
c. public $amnt = ’500′;
d. protected $name = ‘Quantas Private Limited’;
Answer: b;
———————————————————————————————————————
————————————————————-
Question:
What will be the output of following code?

$arr = “a”;
$arr[0]=”b”;
echo $arr;
echo $arr[0];

a. ab
b. $arr is undefined
c. bb
d. Parse error

Answer c
———————————————————————————————————————
————————————————————-
Question:
For the following code:

the output will be:

a. 171
b. Expressions can’t be used with echo statements
c. 150.7
d. 30 * 5.7
Answer a;
———————————————————————————————————————
————————————————————-
Question:
What is the result of the following expression?

5+2 * 4+6

a. 70
b. 19
c. 34
d. 21
Anwer: b
———————————————————————————————————————
————————————————————-

Question:
What will be the output of following code?

$var = 1 + “-1.3e3″;
echo $var;

a. -1299
b. 1
c. 1-1.3e3
d. Error:cannot add integer and string

An swer: a
———————————————————————————————————————
————————————————————-
Question:
What will be the output of following code?

$var1=”a”;
$$var1=”b”;
echo “$var1 $a”;
a. a b
b. $var1 $a
c. Error: $a is undefined
d. Error: Parse error in line 2 ($$var1 = “b”)

Answer a

———————————————————————————————————————
————————————————————-
Question:
What is the output of the following code?

$a = 500;
$b = 200;

echo $a % 2
* $b;
?>

a. 100
b. 200
c. 500
d. 0
e. Syntax error

Anwer d;
———————————————————————————————————————
————————————————————-
Question:
What will be the ouput of the following code?

if (-1)
print “true”;
else
print “false”;
?>

a. true
b. false

Answer a
———————————————————————————————————————
————————————————————-

Question:
What will be the output of the following code?
echo 12 . 6;

a. 12 . 6
b. 126
c. 12.6
d. Error: You cannot add integers through the concatenation operator(.)

Answer: 126
———————————————————————————————————————
————————————————————-
Question:
Consider the following sample code:

$x = 0xFFFE;
$y = 2;
$z = $x && $y;

What will be the value of $z?

a. 0
b. 1
c. 2
d. 3
e. 4

Answer: 1

———————————————————————————————————————
————————————————————-
Question

The setrawcookie() method of setting cookies is different from PHP standard method of cookie
setting as:

a. It does not allow expiry time to be set
b. It can be used only once
c. It does not URL-ENCODE the value on its own
d.It does not allow domain setting

Solution:

C
———————————————————————————————————————
————————————————————-
Question
You need to keep an eye on the existing number of objects of a given class without introducing a
non-class varibale. which of the following makes this happen?

a. Add a member varibale that gets incremented in the default constructer and decremented the
destructer.
b. Add a local variable that gets incremented in each constructer and decremented in the
desructer
c. Add a static member variable that gets incremented in each constructer and decreented in the
destructor
d. This cannot be accomplished since the creation of objects is being done dynamically via
“new”
———————————————————————————————————————
————————————————————-

Question

How can you hide the fact that web pages are written in PHP?

a. By using AddType application/X-httpd-php asp
b. Specify all file names without any dot and extension
c. By using .htaccess diretive in Apeche
d. All of the above

Ans:C
———————————————————————————————————————
————————————————————-
Question

What is the output of the following code?

$a = 3;
$b = 2;
echo (int)$a/(int)$b
?>

a. 1
b. 1.5
c. 2
d. 3
e. Eroor

Ans:b
———————————————————————————————————————
————————————————————-
Question
Which one is correct?

a. $s = fwrite (“a string here”);
b. $s = fwrite ($fp,”a string here”);
c. $s = fwrite (“a string here”,$fp);
d. non of the above

Ans:b
———————————————————————————————————————
————————————————————-
Question

Which of the following set of operations is not valid in PHP 5?

a. >, >=
b. =,==
c. !==,!==
d. +=, *=

Ans :C
———————————————————————————————————————
————————————————————-
Question

Late PHP version support remote file accessing for the functions:

a. include()
b. include_once()
c. require_once()
d. All of the above

Ans:D
———————————————————————————————————————
————————————————————-

PHP Test And solutions
Question.

which of the following are used for code reuse?

a. Loops
b. functions
c. Database
d. include files

Ans:B,D
———————————————————————————————————————
————————————————————-

Question

Which of the following are ”magic constant’?

a. __LINE__
b. __FILE__
c __PRETTY_FUNCTION__
d __CLASS__
e. __METHOD__

Solution:

Question

Which one of the following is turnary operator?

a. &
b. =
c.
d. ?:
e. +=
f. &&

Ans
———————————————————————————————————————
————————————————————-
Question

What is the result of the following Exprssion?
5+2*4+6

a. 70
b. 19
c. 34
d. 21

Ans:B
———————————————————————————————————————
————————————————————-
Question.

The default value of register global in PHP is:
a. Off
b. On

Ans:A
———————————————————————————————————————
————————————————————-
Question

What would b the outpur of the following code?

$string = ‘good day’;
$string = ucword($string);
echo $string;
?>

a. good day
b. GOOD DAY
c. Good Day
d. non of the above

Ans:C
———————————————————————————————————————
————————————————————-
Question

If you want to pass a value to a function by reference, the correct way is:

a. function ModifyReport(&$Rptfile){}
b. function ModifyReport($Rptfile){}
c. function ModifyReport(ByRef $Rptfile){}
d. function ModifyReport(&Rptfile){}

Ans
Question: given below is a small php script:

class person{
Function getSal()
{
…..
…..
…..
}
}
Class emp extends person{
funciton GetSal()
{
???
}
}
?>
The getSal() of emp has to behave exactly as getSal() of person .which of the folliwing lines of
code would you use to replce the

????
a. perent:: getSal();
b. person:: getSal();
c. parent:: getSal;
d. person:: getSal;

Ans: D
———————————————————————————————————————
————————————————————-
Question
what would be the output of the following code?
$stg=’good day’;
$stg= ucwords($stg);
echo $stg;
?>
a. good day
b. GOOD DAY
c. Good Day
d None of the above
Ans: C

———————————————————————————————————————
————————————————————-
Question:

which of the following command line interface constant is not defined in the cli sapi?
a. STDIN
b. STDOUT
c. STDPRT
d STDERR

Ans:C
———————————————————————————————————————
————————————————————-
Question:

if the session_cache_expire()is not set,then by default the session cache will expire after:

a. 1 hr
b. 2 hr
c. 3 hr
d 4 hr

Ans:C

———————————————————————————————————————
————————————————————-

Question:
Which of the following is not a correct way of commenting in php?
a. //php comment
b. /*php comment*/
c. #php comment
d /# php comment

Ans:D

———————————————————————————————————————
————————————————————-

Question:
What is true regarding this code?
a. setcookie will return false
b. setcookie will return true
c. setcookie will return null
d. Any of the above can happen

Ans: b
———————————————————————————————————————
————————————————————-
Question:
Which of the following is not a correct way of printing text in php5?
a. echo “Plain text”;
?>
b.
c.
d. <# echo “Plain text” #>
Ans :a

———————————————————————————————————————
————————————————————-
Question:
Which of the following is not the correct way of starting a session?

a. session.auto_start
b. session_register()
c. session_initiate()
d. session_start()
Ans: c;
———————————————————————————————————————
————————————————————-

Question:
Which of the following functions do you need to implement HTTP Basic Authentication?

a. authenticate ()
b. header ()
c. basic_auth ()
d. None of the above
Ans: d;

———————————————————————————————————————
————————————————————-
Question:
Which of the following Command Line Interface constant is not defined in the CLI SAPI?

a. STDIN
b. STDOUT
c. STDPRT
d. STDERR

Ans: c;

———————————————————————————————————————
————————————————————-
Question:
Which of the following statements is correct with regard to final and abstract?
a. An abstract class cannot have final methods
b. An abstract class cannot have non abstract methods
c. A final class cannot have abstract methods
d. A final class cannot have final methods

Ans:
———————————————————————————————————————
————————————————————-
Question:
Which composite data types are supported by php?

a. Array
b. Enumeration
c. List
d. Object
e. Integer

Ans: a

———————————————————————————————————————
————————————————————-
Question:
The default value of register_globals in PHP is:

a. Off
b. On

Ans: a

———————————————————————————————————————
————————————————————-
Question:
Which of the following is not a valid PHP connection status?

a. aborted
b. normal
c. open
d. timeout

Ans; c

———————————————————————————————————————
————————————————————-

Question:
Choose the correct statement:
a. include() includes and evaluates a specific file
b. require() includes and evaluates a specific file
c. include_once() includes and evaluates a specific file only if it has not been included before
d. require_once() includes and evaluates a specific file only if it has not been included before
e. All of the above

Ans: e
———————————————————————————————————————
————————————————————-
Question:
If the session_cache_expire() is not set, then by default the session cache will expire after:

a. 1 hr
b. 2 hrs
c. 3 hrs
d. 4 hrs

Ans: 3

———————————————————————————————————————
————————————————————-
Question:
What will be the output of the following script?

$count=50;
function Argument()
{
$count++;
echo $count;
}
Argument();
?>

a. It will print 50
b. It will print 51
c. It will print 52
d. It will print 1

Ans: d;
———————————————————————————————————————
————————————————————-

Question:
State whether True or False

Paamayim Nekudotayim operator allows access only to the static members of a class?
a. True
b. False

Ans: a
———————————————————————————————————————
————————————————————-
Question:
Which of the following statements is true with regard to comparisons in PHP5?

a. With “= =” operator, two object instances are equal if they have the same attributes and
values, and are instances of a different class.
b. With “==” operator two object instances are equal if they have the same attributes and values,
and are instances of the same class.
c. With (===) operator, object variables are identical if and only if they refer to the same instance
of the same class.
d. With (===) operator, object variables are identical if and only if they refer to the different
instance of the same class.

Ans: c;
———————————————————————————————————————
————————————————————-
Question:
You have to upload a file using form post method:

1
2 Send this file:
3
4

What should be the code in line 3, if the file name to upload is “SalesFile”?

a.
b.
c.
d.

Ans a;

———————————————————————————————————————
————————————————————-
Question:
Which of the following built-in function assist in checking if actually the function exists or not?

a. exists
b. function_exists
c. fexists
d. isFunction
Ans: b;
———————————————————————————————————————
————————————————————-
Question:
What will be the output of the following code?

$a = 0.0;

for ($i = 0; $i < a =”=”">

a. 0.9
Not Equals
b. 1
Equals
c. 1
Not Equals
d. 1.1
Not Equals
e. None of the above

Ans: c
———————————————————————————————————————
————————————————————-
Question:
What will be the output of the following code?

$i=4;
$j=30;
$k=0;
$k=$j++/$i++;
echo $i . ” ” . $j . ” ” . $k . ” “;

a. 5 31 6
b. 5 31 6.2
c. 5 31 7
d. 4 31 7.5
e. 5 31 7.5

Ans e;
———————————————————————————————————————
————————————————————-
Question:
Which of the following is a not a correct way of commenting in php?
a. //PHP Comment
b. /*PHP Comment*/
c. #PHP Comment
d. /#PHP Comment
Ans d;
———————————————————————————————————————
————————————————————-
Question:
Following is a php code block:

$m=9;
$n=99;
$z=8;
$z=$n++/$m++ + –$z;
echo $z;

what will be the output?

a. 16
b. 18
c. 19
d. 20
e. 17
Ans 18;
———————————————————————————————————————
————————————————————-

Question:
Which of the following is the correct way of specifying default value?

a. function GetDiscount($Type = “Special”) { . . . }
b. function GetDiscount(Type := “Special”) { . . . }
c. function GetDiscount($Type := “Special”) { . . . }
d. function GetDiscount($Type : “Special”) { . . . }

Ans a;

———————————————————————————————————————
————————————————————-
Question:
With reference to the following php script:

print ‘Text Line1′
print ‘Text Line2′
?>
What will be the output on running the script?

a. Text Line1Text Line2
b. Text Line1 Text Line2
c. ‘Text Line1′
d. ‘Text Line2′
e. Error message will be printed
Ans e;
———————————————————————————————————————
————————————————————-

Question:
What will be the ouput of the following code?

for ($i = 0; $i < i =”=”">

a. 0
1
2
3
4
5
b. 0
1
3
4
c. 2
d. 0
1
2
4
e. None of the above

Ans b;
———————————————————————————————————————
————————————————————-

Question:
Late PHP versions support remote file accessing for the functions:

a. include()
b. include_once()
c. require_once()
d. Both a and b
e. Both b and c
Ans e;

———————————————————————————————————————
————————————————————-
Question:
You have designed a user login form as follows:

User Name:

Password:

How can you access the username entered by the user in the ‘Validate.php’ webpage?

a. $var= $_POST['username'];
b. $var= $_REQUEST['username'];
c. import_request_variables(‘p’, ‘p_’);
$var= $p_username;
d. All of the above

Ans: d
———————————————————————————————————————
————————————————————-

Question:
Which of the following does not represent logical AND operator in PHP?

a. &
b. &&
c. And
d. AND

Ans: a
———————————————————————————————————————
————————————————————-

Question:
Which of the following is not true for a persistent connection?

a. These are not closed even after the execution of the script
b. These are mainly used to increase the efficiency of the system
c. These can’t be converted to non-persistent connections
d. These are preferably not used in the scripts involving transactions
Ans c;
———————————————————————————————————————
————————————————————-
Question:
Which of the following are invalid data types in PHP?

a. string
b. integer
c. float
d. char
e. array
f. object
Ans d
———————————————————————————————————————
————————————————————-

Question:
The Manager and Office classes are as follows:

class Manager{
function printName() {
echo “Manager”;
}
}
class Office{
function getManager() {
return new Manager();
}
}

$ofc = new Office();
???

?>

Which of the following should replace ‘???’ to obtain the value of printName() function?

a. $ofc->getManager()->printName();
b. new Office()->getManager()->printName();
c. $ofc->getManager->printName;
d. Office::getManager()::printName();
Ans a
———————————————————————————————————————
————————————————————-

Question:
The classes are defined as follows:
abstract class BaseCls{
protected abstract function getName();
}

class ChildCls extends BaseCls{

}

Which of the following implementations of getName() is invalid in ChildCls?

a. protected function getName(){}
b. function getName(){}
c. private function getName(){}
d. public function getName(){}

Answer d;

———————————————————————————————————————
————————————————————-
Question:
Which of the following variable declarations within a class is invalid in PHP5?

a. private $type = ‘moderate’;
b. var $term =3;
c. public $amnt = ’500′;
d. protected $name = ‘Quantas Private Limited’;
Answer: b;
———————————————————————————————————————
————————————————————-
Question:
What will be the output of following code?

$arr = “a”;
$arr[0]=”b”;
echo $arr;
echo $arr[0];

a. ab
b. $arr is undefined
c. bb
d. Parse error

Answer c
———————————————————————————————————————
————————————————————-
Question:
For the following code:
the output will be:

a. 171
b. Expressions can’t be used with echo statements
c. 150.7
d. 30 * 5.7
Answer a;
———————————————————————————————————————
————————————————————-
Question:
What is the result of the following expression?

5+2 * 4+6

a. 70
b. 19
c. 34
d. 21
Anwer: b
———————————————————————————————————————
————————————————————-

Question:
What will be the output of following code?

$var = 1 + “-1.3e3″;
echo $var;

a. -1299
b. 1
c. 1-1.3e3
d. Error:cannot add integer and string

An swer: a
———————————————————————————————————————
————————————————————-
Question:
What will be the output of following code?

$var1=”a”;
$$var1=”b”;
echo “$var1 $a”;

a. a b
b. $var1 $a
c. Error: $a is undefined
d. Error: Parse error in line 2 ($$var1 = “b”)

Answer a

———————————————————————————————————————
————————————————————-
Question:
What is the output of the following code?

$a = 500;
$b = 200;

echo $a % 2
* $b;
?>

a. 100
b. 200
c. 500
d. 0
e. Syntax error

Anwer d;
———————————————————————————————————————
————————————————————-
Question:
What will be the ouput of the following code?

if (-1)
print “true”;
else
print “false”;
?>

a. true
b. false

Answer a
———————————————————————————————————————
————————————————————-

Question:
What will be the output of the following code?

echo 12 . 6;
a. 12 . 6
b. 126
c. 12.6
d. Error: You cannot add integers through the concatenation operator(.)

Answer: 126
———————————————————————————————————————
————————————————————-
Question:
Consider the following sample code:

$x = 0xFFFE;
$y = 2;
$z = $x && $y;

What will be the value of $z?

a. 0
b. 1
c. 2
d. 3
e. 4

Answer: 1

———————————————————————————————————————
————————————————————-
Question

The setrawcookie() method of setting cookies is different from PHP standard method of cookie
setting as:

a. It does not allow expiry time to be set
b. It can be used only once
c. It does not URL-ENCODE the value on its own
d.It does not allow domain setting

Solution:

C
———————————————————————————————————————
————————————————————-
Question

You need to keep an eye on the existing number of objects of a given class without introducing a
non-class varibale. which of the following makes this happen?
a. Add a member varibale that gets incremented in the default constructer and decremented the
destructer.
b. Add a local variable that gets incremented in each constructer and decremented in the
desructer
c. Add a static member variable that gets incremented in each constructer and decreented in the
destructor
d. This cannot be accomplished since the creation of objects is being done dynamically via
“new”
———————————————————————————————————————
————————————————————-

Question

How can you hide the fact that web pages are written in PHP?

a. By using AddType application/X-httpd-php asp
b. Specify all file names without any dot and extension
c. By using .htaccess diretive in Apeche
d. All of the above

Ans:C
———————————————————————————————————————
————————————————————-
Question

What is the output of the following code?

$a = 3;
$b = 2;
echo (int)$a/(int)$b
?>

a. 1
b. 1.5
c. 2
d. 3
e. Eroor

Ans:b
———————————————————————————————————————
————————————————————-
Question

Which one is correct?
a. $s = fwrite (“a string here”);
b. $s = fwrite ($fp,”a string here”);
c. $s = fwrite (“a string here”,$fp);
d. non of the above

Ans:b
———————————————————————————————————————
————————————————————-
Question

Which of the following set of operations is not valid in PHP 5?

a. >, >=
b. =,==
c. !==,!==
d. +=, *=

Ans :C
———————————————————————————————————————
————————————————————-
Question

Late PHP version support remote file accessing for the functions:

a. include()
b. include_once()
c. require_once()
d. All of the above

Ans:D
———————————————————————————————————————
————————————————————-

PHP Test And solutions
Question.

which of the following are used for code reuse?

a. Loops
b. functions
c. Database
d. include files

Ans:B,D
———————————————————————————————————————
————————————————————-

Question

Which of the following are ”magic constant’?

a. __LINE__
b. __FILE__
c __PRETTY_FUNCTION__
d __CLASS__
e. __METHOD__

Solution:

Question

Which one of the following is turnary operator?

a. &
b. =
c.
d. ?:
e. +=
f. &&

Ans
———————————————————————————————————————
————————————————————-
Question

What is the result of the following Exprssion?
5+2*4+6

a. 70
b. 19
c. 34
d. 21

Ans:B
———————————————————————————————————————
————————————————————-
Question.

The default value of register global in PHP is:
a. Off
b. On

Ans:A
———————————————————————————————————————
————————————————————-
Question

What would b the outpur of the following code?

$string = ‘good day’;
$string = ucword($string);
echo $string;
?>

a. good day
b. GOOD DAY
c. Good Day
d. non of the above

Ans:C
———————————————————————————————————————
————————————————————-
Question

If you want to pass a value to a function by reference, the correct way is:

a. function ModifyReport(&$Rptfile){}
b. function ModifyReport($Rptfile){}
c. function ModifyReport(ByRef $Rptfile){}
d. function ModifyReport(&Rptfile){}

Ans

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:32
posted:5/16/2012
language:English
pages:42