21. What will be the output of the following PHP code?
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
22. What will be the output of the following PHP code?
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
a();
a();
?>
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
a();
a();
?>
23. What will be the output of the following PHP code?
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
24. What will be the output of the following PHP code?
<?php
$op2 = "blabla";
function foo($op1)
{
echo $op1;
echo $op2;
}
foo("hello");
?>
<?php
$op2 = "blabla";
function foo($op1)
{
echo $op1;
echo $op2;
}
foo("hello");
?>
25. What will be the output of the following PHP code?
<?php
function foo($msg)
{
echo "$msg";
}
$var1 = "foo";
$var1("will this work");
?>
<?php
function foo($msg)
{
echo "$msg";
}
$var1 = "foo";
$var1("will this work");
?>
26. What will be the output of the following PHP code?
<?php
echo "chr(52)";
?>
<?php
echo "chr(52)";
?>
27. What will be the output of the following PHP code?
<?php
echo ord ("hi");
?>
<?php
echo ord ("hi");
?>
28. What will be the output of the following PHP code?
<?php
echo(atan(0.50));
?>
<?php
echo(atan(0.50));
?>
29. What will be the output of the following PHP code?
<?php
define("GREETING","Hello you! How are you today?");
echo constant("GREETING");
?>
<?php
define("GREETING","Hello you! How are you today?");
echo constant("GREETING");
?>
30. What will be the output of the following PHP code?
<?php
define("GREETING1","Hello you! How are you today?");
define("GREETING2","Hello you! How are you today?");
define("GREETING3","Hello you! How are you today?");
echo defined("GREETING");
?>
<?php
define("GREETING1","Hello you! How are you today?");
define("GREETING2","Hello you! How are you today?");
define("GREETING3","Hello you! How are you today?");
echo defined("GREETING");
?>