Page 171 - Open Soource Technologies 304.indd
P. 171
Unit 7: Multidimensional Arrays
echo “Entering $name (stack is now: “ . join(‘ -> ‘, $call_trace) . ‘)<br />’; Notes
}
function exit_function( ) {
echo ‘Exiting<br />’;
global $call_trace;
array_pop($call_trace); // we ignore array_pop( )’s return value
}
function first( ) {
enter_function(‘first’);
exit_function( );
}
function second( ) {
enter_function(‘second’);
first( );
exit_function( );
}
function third( ) {
enter_function(‘third’);
second( );
first( );
exit_function( );
}
first( );
third( );
Here’s the output from Example:
Entering first (stack is now: first)
Exiting
Entering third (stack is now: third)
LOVELY PROFESSIONAL UNIVERSITY 165