Page 1 of 1

Functions within functions

Posted: Fri Jan 28, 2005 7:27 am
by kloining
Hi guys, been searching "all over the web" now to find a solution, but it's "impossible". :(

Anyway, here's the problem:

Code: Select all

<?php
class pub
&#123;
	function a()
	&#123;
		function b()&#123; &#125;
	&#125;
&#125;
?>
I know I can call the b()-function by doing this:
pub::a();
b();

But after calling pub::a();
I want to be able to call pub::b();

Regards, Kristian

Posted: Fri Jan 28, 2005 8:03 am
by feyd
it has to be defined as part of the class. i.e. it has to be in the class' definition, not a function implementation.