Online Test for PHP
- Find Error/Output in follwing code:
<?php
class MyClass
{
const CONST_VAR = 'Right';
function showConstant() {
echo $this->CONST_VAR;
}
}
$class = new MyClass();
$class->showConstant();
?>
Right
No output
Undefined property
None of the above
- PECL stands for?
PHP Extension Community LaboratoryPHP Extension Combined LibraryPHP Export Community LibraryPHP Extension Community Library
- If class implementing the interface does not use exact same method signatures as are defined in the interface. Will show
No ErrorFatal ErrorWarning ErrorNotice Error
- In terms of keywords and language syntax, PHP is similar to?
CCOBOLFORTRAN.Net
- _______ function is used to sort an array in ascending order by value while preserving key associations.
ksort()asort()krsort()usort()
- How to typecast a variable to Boolean?
$var = $var == $var;$var = (true)$var;$var = (bool)$var;Variable cannot be typecast in Boolean
- Which is correct statement to terminate PHP statement?
Semicolon at the end of each statementThe closing tag of a block of PHP code automatically implies a semicolon;Colon at the end of each statementA & B
- Find Error/Output in follwing code:
<?php
$email = 'sumit@gmail.com';
$user = strstr($email, '@', true);
echo $user;
?>
sumit
@gmail.com
gmail.com
sumit@
- What is the name of function used to convert an array into a string?
explode()glue()implode()None of the above
- If cookie expiration time is not set explicitly, what happens to it?
It expires right awayIt never expiresIt is not setIt expires at the end of the user's browser session
Also Exercise
Post Your Question
Social Sharing
Search
Articles
Recently Added Jobs
Rajasthan High Court - Jodhpur Recruitment 2017 for Civil Judges
Last Date: 21 December, 2017
Last Date: 21 December, 2017
WBSEDCL Recruitment - 2017 for Office Executive
Last Date: 16 May, 2017
Last Date: 16 May, 2017
RECRUITMENT OF PROBATIONARY OFFICERS IN STATE BANK OF INDIA
Last Date: 06 March, 2017
Last Date: 06 March, 2017
UPSC Combined Medical Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015
UPSC Engineering Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015