G. H. "; $x++; } for($i=1;$i<=3;$i++) myTest(); ?> I.

icon
Related questions
Question

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

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: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; ?>
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;
?>
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
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer