Submitted by Raghu (not verified) on Wed, 01/20/2010 - 08:34.
Output of the given program will be syntax error.
ans: d
When line echo 'hello $x'; will execute it will give following error:Parse error: parse error, expecting `','' or `';''
Submitted by Sunil Raghuwanshi (not verified) on Thu, 12/24/2009 - 05:47.
the ans must be c because echo 'Hello $x';every thing in between "" or '' is string it not depend on the variable that declare above so Hello $x is the string because it is in single '' so the ans is Hello $x
ans
b is correct answer....
if u see echo line 3 its -> echo `hello $x`;
and not echo 'hello $x';
so it will throw a parse error....:)
Actual answer follows...
$x = 'Sunil';
echo "Hello $x";
?>
answer : Hello Sunil
$x = 'Sunil';
echo 'Hello $x';
?>
ans:c => Hello $x
Actual answer follows...
$x = 'Sunil';
echo "Hello $x";
?>
answer : Hello Sunil
$x = 'Sunil';
echo 'Hello $x';
?>
ans:c => Hello $x
Ans:- b Parse error: parse
$x = 'Sunil';
echo ‘Hello $x’;
?>
Ans:- b
Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in C:\wamp\www\exp.cpp
New Answer
ans:b
Output of the given program
Output of the given program will be syntax error.
ans: d
When line echo 'hello $x'; will execute it will give following error:Parse error: parse error, expecting `','' or `';''
output
Make sure you are using single quote....
Single quote will not parse PHP variables and there will be no such parse error in this case. And there is no question of being a syntax error too
the ans: c
the ans must be c because
the ans must be c because echo 'Hello $x';every thing in between "" or '' is string it not depend on the variable that declare above so Hello $x is the string because it is in single '' so the ans is Hello $x
c
c
php
$x = 'Sunil';
echo ‘Hello $x’;
?>
ans:b
$x = 'Sunil';
echo 'Hello $x';
?>
ans:c
C is correct answer
C is correct answer
Post new comment