What is the outcome of this piece of code:
<?php
$webmull= decoct(125);
echo $webmull;
?>

301
105
175
157

Correct!

Wrong!

What is the outcome of this piece of code:
<?php
$webmull = "true";
echo gettype($webmull);
echo empty($webmull);
echo is_null($webmull);
echo isset($webmull);
?>

boolean1
string001
boolean001
String1

Correct!

Wrong!

What is the output of the following code?
<?php
for ($php = 0; $php < 1.02; $php += 0.17) {
$webmull[$php] = $php;
}
echo count($webmull);
?>

0
1
2
6
7

Correct!

Wrong!

What is the output of the following script?
<?php
function webmull ($web = 20, $mull)
{
if (isset ($mull)) {
return $mull / $web;
}
}
echo webmull (0);
?>

0
An integeroverflow error
A warning, because $web is not set
A warning, because $mull is not set
A floating-point overflow error

Correct!

Wrong!

What is the outcome of this piece of code?
<?php
namespace version\one;
function strlen($str) {
echo \strlen($str);
}
use version\one;
echo strlen('book');
?>

book
4
an endless loop
a fatal error

Correct!

Wrong!

Output of the following script will be ?
<?php
$phpcount = 50;
function webmull() {
$phpcount++;
echo $phpcount;
}
webmull();
?>

It will print 52
It will print 1
It will print 50
It will print 51
None of above

Correct!

Wrong!

what would be output of following php code?
<?php
$a = 10;
echo 'Value of a = $a'
?>

Undefined
Syntax Error
Value of a = 10
Value of a = $a
None of above

Correct!

Wrong!

what would be output of following php code?
<?php
$php_var = 18;
echo "Value of php_var = $php_var";
?>

Undefined
Syntax Error
Value of php_var = 18
Value of php_var = $php_var
None of the above

Correct!

Wrong!

The output of ofllowing script would be?
<?php
function webmull () {
global $php_webmull;
$php_webmull++ ;
echo "php_webmull is $php_webmull";
}
webmull ();
?>

php_webmull is 17
php_webmull is 18
php_webmull is 1
php_webmull is $php_webmull

Correct!

Wrong!

Output of the following code will be?
<?php
$php_var = 20;
function webmull() {
$php_var = 40;
return $php_var;
}
webmull();
echo $php_var;
?>

Syntax Error
40
20
Undefined Variable

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

PHP Interview Questions on Array, Function, Variable Scope

I got %%score%% of %%total%% right

%%description%%

%%description%%

Loading...