can we define a php function within a php function..??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahullko05
    New Member
    • Oct 2008
    • 34

    can we define a php function within a php function..??

    if it is possible then is it a good practice to include a function inside another function..?? how can we assure about its maintenability and its performance.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Please see anonymous functions / closures and, if you're on something older than PHP5.3, see create_function ().

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      not that I know of. And I wouldn’t consider it a good practice either (in contrast to javascript, where such an inner function serves a certain purpose).

      EDIT: admittedly, I didn’t think of anonymous functions…

      Comment

      Working...