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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mark at seventhcycle dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 13:01:33 2025 UTC