Your right ... you can write the code for a function within a function, but there are no methods for accessing the outer function's variables. Also, if you call the outer function twice, you get that error because you can only declare a function once (it considers you've declared it a second time). Pity .....
Perhaps a quick bug submission would be worthwhile? http://bugs.php.net/
All the best,
Louis