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
   166   167   168   169   170   171   172   173   174   175   176