php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #16979 nested function in functions within a class
Submitted: 2002-05-02 18:29 UTC Modified: 2012-09-22 09:13 UTC
From: lazybrain at rcn dot com Assigned: nikic (profile)
Status: Closed Package: *General Issues
PHP Version: 4.1.2 OS: bsd
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lazybrain at rcn dot com
New email:
PHP Version: OS:

 

 [2002-05-02 18:29 UTC] lazybrain at rcn dot com
It would be helpfull to be able to 
use nested functions inside a function thats in a class.

For example...

clase something {

 function test1() {
  do something here

  // quick function to make code smaller
  function test2() {
   do more here
  }
 }

 
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-12 13:57 UTC] ahristov at icygen dot com
AFAIK this code could work. I've written some code this way but the user has to guard the definition of the function somehow or on the second call os test1 there will be fatal error.
 [2012-09-22 09:13 UTC] nikic@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: nikic
 [2012-09-22 09:13 UTC] nikic@php.net
Closing as this already works.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 18:01:32 2024 UTC