Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- edward@vds1:~$ cat /home/edward/test.static.php
- <?php
- test(1,2);
- test(3,2);
- test(1,5);
- test(90,15);
- function test($a,$b) {
- static $foo = array();
- $foo[$a] = $b;
- print_r($foo);
- }
- ?>
- edward@vds1:~$ php /home/edward/test.static.php
- Array
- (
- [1] => 2
- )
- Array
- (
- [1] => 2
- [3] => 2
- )
- Array
- (
- [1] => 5
- [3] => 2
- )
- Array
- (
- [1] => 5
- [3] => 2
- [90] => 15
- )
Add Comment
Please, Sign In to add comment