I have the following codes:
<?php
// a)
function fnTripple($a)
{
$a = $a * $a;
return 3;
}
echo fnTripple(4);
// b)
$a = 5;
$b = 5;
// c)
$b = $b + $a;
// d)
$d = $d + $b;
$e = $e + $b;
// e)
$f = function ($d)
// f)
$g = function ($d)
{
$e++;
}
// g)
echo $a
echo $b
echo $c
echo $d
echo $e
echo $f
echo $g
?>
This errors appears:
Parse error: syntax error, unexpected T_VARIABLE, expecting '{' in C:\xampp\htdocs\php_exercise\exercise5.php on line 36
Line 36 is $g = function ($d)
What might be the problems?
Thanks.