php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28928 Function_Find_Def() request
Submitted: 2004-06-25 19:38 UTC Modified: 2008-01-01 16:06 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mark at seventhcycle dot net Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5 OS: n/a
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-06-25 19:38 UTC] mark at seventhcycle dot net
Description:
------------
For large projects that are coded without any sort of directed structure, it's often very difficult to know where a user defined function is defined / located.

What would be great to add to PHP would be a function that finds the filename / line # that the function is defined:

See below for how it would work.  I think this'd be a big help to a lot of developers.  Thanks in advance, guys!

Reproduce code:
---------------
<?php

   // This Filename = "sample.php"

   function GenericFunction()
   {
       return $x;
   }

   $arr = Function_Find_Def("GenericFunction");
   echo "<BR>" . $arr["FileName"];
   echo "<BR>" . $arr["LineNumber"];

Expected result:
----------------
sample.php
Line 5


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-01 16:06 UTC] magnus@php.net
You can already do this with the reflection api, see 
http://www.php.net/reflection
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 10:01:32 2024 UTC