The pseudo-variable ...... is available inside any class method when that method is called from within an object context.
A. $construct
B. #this
C. $those
D. $this
Select an option to see the answer and solution.
A class may contain its own .............
A. variables
B. functions
C. constants
D. both A and B
E. all of above
Select an option to see the answer and solution.
Child classes are defined using the keyword .....
A. extends
B. extents
C. child_class
D. extend_class
Select an option to see the answer and solution.
In PHP, the difference between double quote and single quote is that variables . . . . in single quoted strings whereas they . . . . . in double quoted strings.
A. are not parsed, are parsed
B. are parsed, are not parsed
C. are class, are not class
D. are variables, are not variables
Select an option to see the answer and solution.
PHP strings are binary-safe (i.e. they can contain null bytes) . Their size is limited only by the amount of memory that is available to PHP.
Select an option to see the answer and solution.
What is the output of below statement?
Print substr (‘watch out for that tree’,20,5) ;
A. tree
B. tree’
C. ree
D. none of above
Select an option to see the answer and solution.
What is the value of var?
$var = 'HELLO WORLD!';
v a r < ! − − ? s p an − − >< s p an c l a ss = " p − r e d " >=< / s p an > u c f i r s t < s p an c l a ss = " p − r e d " > ( < / s p an > var) ;
A. Hello World!
B. hello world!
C. Hello world!
D. HELLO WORLD!
Select an option to see the answer and solution.
The functions strtolower() and strtoupper() work on individual characters and not on entire strings.
Select an option to see the answer and solution.
Heredoc's are a great alternative to quoted strings because of increased readability and maintainability.
Select an option to see the answer and solution.
Which of the below is most useful for debugging:
A. print()
B. printf()
C. print_r()
D. echo
Select an option to see the answer and solution.
What is the value of message?
$name = “John”;
m ess a g e < / s p an >< s p an c l a ss = " p − r e d " >=< / s p an > ‘ H e l l o , name’;
A. Hello, John
B. it will print an error message
C. ‘Hello, $name’
D. none of above
Select an option to see the answer and solution.
The result of below statements will be:
$str = ""Hello fri3nd, you're
feeling happy today?”;
echo str_word_count ( $str) ;
Select an option to see the answer and solution.
PHP recognises constructors by the name . . . . .
A. _construct
B. __construct
C. __constructor
D. _constructor
Select an option to see the answer and solution.
In . . . . . constructors, it is important to remember that you have to call the parent constructor explicitly.
A. Singleton
B. secure
C. public
D. subclass
Select an option to see the answer and solution.
Constructor and destructor methods have no . . . . . . and are called automatically - they cannot be called explicitly and consequently their declarations need no access specifier.
A. parameters
B. destructor
C. return value
D. aproval
Select an option to see the answer and solution.
Unlike constructors, you cannot pass information to a destructor, because you are never sure when its going to be run.
Select an option to see the answer and solution.
You can invoke class constructors that don’t have any relation to the instantiated object by simply prefacing _constructor with the class name like.
A. classname::__construct()
B. classname:__construct()
C. classname=>__construct()
D. classname->__construct()
Select an option to see the answer and solution.
. . . . . . is a class which can only be instantiated once. You can effectively only have one object per . . . . . class in an application.
A. Constructor, Singleton
B. Singleton, Constructor
C. Singleton, Singleton
D. Loader, Loader
Select an option to see the answer and solution.
Even if you don’t delete the object yourself using . . . . . , PHP still calls the destructor when it determines that the object is no longer used.
A. destructor
B. del()
C. rem()
D. unset()
Select an option to see the answer and solution.
You can overwrite a Singleton with the wrong kind of data.
Select an option to see the answer and solution.