Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dvprog_11 [2020-02-10 11:19] Daniel Viström |
dvprog_11 [2022-07-18 13:20] (current) |
||
---|---|---|---|
Line 95: | Line 95: | ||
$y = 6; | $y = 6; | ||
// Variablerna behöver inte ha samma namn som i funktionen. | // Variablerna behöver inte ha samma namn som i funktionen. | ||
- | $sum = summa($x, $y) . '< | + | $sum = summa($x, $y); |
echo $sum . '< | echo $sum . '< | ||
Line 103: | Line 103: | ||
echo $summa . '< | echo $summa . '< | ||
// Blir felmeddelande. $summa finns bara i funktionen. | // Blir felmeddelande. $summa finns bara i funktionen. | ||
+ | |||
echo $tal1 . '< | echo $tal1 . '< | ||
// Värdet har inte förändrats trots att funktionen har körts. | // Värdet har inte förändrats trots att funktionen har körts. |