Hello friends....!!!
On your huge response of last PHP test...
Here is a weekly Test for PHP developers...
it is a test of object oriented concepts in PHP...
Here we go...
(includes 5 theory questions and 5 programs)
THEORY
a) Abstract
b) Protected
c) Final
d) Static
a) classname()
b) _construct()
c) function _construct()
d) function __construct()
a) class creation
b) object creation
c) object instantiation
d) class instantiation
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6
Que.1
In the PHP code given below, what is/are the properties?
b) public $name;
c) class Example
d) function sample()
Que.2 What will be the output of the following PHP code?
b) bool(false)
c) Error
d) None of the above
Que. 3 What will be the output of the following PHP code?
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
Que 4 What will be the output of the following code?
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob
Que. 5 What will be the output of the following PHP code?
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
So, test your skills by solving the PHP test questions......
answer sheet of this Question paper will be available tomorrow...
leave a reply....
regards : m2soft solutions Pvt Ltd
On your huge response of last PHP test...
Here is a weekly Test for PHP developers...
it is a test of object oriented concepts in PHP...
Here we go...
(includes 5 theory questions and 5 programs)
THEORY
Que. 1
Which method scope prevents a method
from being overridden by a subclass?
a) Abstract
b) Protected
c) Final
d) Static
Que.2
PHP recognizes constructors by the
name..
a) classname()
b) _construct()
c) function _construct()
d) function __construct()
Que 3
The practice of creating objects
based on predefined classes is often referred to as..
a) class creation
b) object creation
c) object instantiation
d) class instantiation
Que.4
The practice of
separating the user from the true inner workings of an application
through well-known interfaces is known as..
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
Que.5
Which version of PHP introduced the
instance of keyword?
a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6
PROGRAMS :
<?php
class Example
{
public $name;
function Sample()
{
echo "This is an example";
}
}
?>
b) public $name;
c) class Example
d) function sample()
Que.2 What will be the output of the following PHP code?
<?php
class MyClass
{
}
$a = new MyClass;
var_dump(!($a instanceof stdClass));
?>
b) bool(false)
c) Error
d) None of the above
Que. 3 What will be the output of the following PHP code?
<?php
class ParentClass
{
}
class MyClass extends ParentClass
{
}
$a = new MyClass;
var_dump($a instanceof MyClass);
var_dump($a instanceof ParentClass);
?>
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
Que 4 What will be the output of the following code?
<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob
Que. 5 What will be the output of the following PHP code?
<?php
interface MyInterface
{
}
class MyClass implements MyInterface
{
}
$a = new MyClass;
var_dump($a instanceof MyClass);
var_dump($a instanceof MyInterface);
?>
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
So, test your skills by solving the PHP test questions......
answer sheet of this Question paper will be available tomorrow...
leave a reply....
regards : m2soft solutions Pvt Ltd
Really nice topics you had discussed above. I am much impressed. Thank you for providing this nice information here.
ReplyDeleteGame Testing
Video Game QA
IOS Game QA Testing Services
Game Performance Testing
Quality Assurance Games