Question
Please solve the parts G, H and I (last three parts)

Transcribed Image Text:Question:
Check the following pieces of code and then determine whether
each piece of code is correct or wrong?
A.<?php
function addNumbers($a, $b)
{ $r = $a + $b;
return $a + $b;
}
$n1 = 6;
$n2 = 7;
echo addNumbers($n1, $n2);
B.<?php
C.<?php
?>
function addNumbers($a, $b)
{ $r = $a + $b;
return $a + $b;
}
$result = addNumbers(4, 11);
echo $result;
?>
function zz($a)
{ $y = 1;
$r = $y + 6;
echo $r;
}
zz(4);
echo $y;
?>

Transcribed Image Text:G.
H.
<?php
function myTest3()
{ define("z", 6); }
myTest3();
echo z;
?>
<?php
function myTest()
{
static $x = 1;
echo $x;
echo "<br/>";
$x++;
for($i=1;$i<=3;$i++)
myTest();
?>
I. <?php
$x = 7;
$y = 10;
function Testing()
{
global $x, $y;
$y: = $x + $y;
}
testing();
echo $y;
?>
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 5 steps with 3 images

Knowledge Booster
Similar questions
- Please draw the truth table of the following proposition.(P→Q) Λ Qarrow_forward3. The velocity of a particle which starts from rest is given by the following table. t see) 0 2 8 10 12 14 16 v (fusee) o 12| 16 26 40| 44 25 12 18 Evaluate using trapezium rule, the total distance travelled in 18 seconds.arrow_forwardConsider the following recurrence: T(1)=1; T(n) = 2.T()+n, for n> 1, n a power of 3. =..... Find T(27) by substitution, starting with n = 1, n = 65 2 169 29 15 6arrow_forward