[ create a new paste ] login | about

Link: http://codepad.org/4R0bZf1B    [ raw code | output | fork ]

PHP, pasted on Apr 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
function someFunction($varset = NULL) {
    static $variable = NULL;
    if ($varset !== NULL) $variable = $varset;
    $variable++;
    echo $variable;
    if ($variable < 5) someFunction();
    return $variable;
}

someFunction(4);
echo "\n";
someFunction(2);
echo "\n";
someFunction(3);

?>


Output:
1
2
3
5
345
45


Create a new paste based on this one


Comments: