# class defs from file?

- Thread: https://externals.io/message/26413
- Original archive: https://news-web.php.net/php.internals/26413
- Started by Tony Bibbs on 2006-11-08T00:54:44+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #26413 — Tony Bibbs — 2006-11-08T00:54:44+00:00

URL: https://externals.io/message/26413#26413

First post here so be gentle ;-)

I've got a unique need to get the class definitions from a file.  Now I 
can write the string manipulation necessary to do this myself with the 
help of some regex-fu but I was wondering if it wouldn't be possible to 
add a method like:

array getClassDefs(string $someFileName)

Like I said, I can do it with some regex work but given the PHP engine 
has to do this it'd seem like a nice addition to the core oo-functions. 
  This may be a case where I've got too specific a need to warrant 
community interest but I'd think there might be other cases where such a 
method would prove handy.

Thoughts (other than the obligatory 'p1ss-off'?

--Tony

---

## #26414 — Jochem Maas — 2006-11-08T00:58:39+00:00

URL: https://externals.io/message/26413#26414 · In reply to: #26413

Tony Bibbs wrote:
> First post here so be gentle ;-)
> 
> I've got a unique need to get the class definitions from a file.  Now I
> can write the string manipulation necessary to do this myself with the
> help of some regex-fu but I was wondering if it wouldn't be possible to
> add a method like:
> 
> array getClassDefs(string $someFileName)
> 
> Like I said, I can do it with some regex work but given the PHP engine
> has to do this it'd seem like a nice addition to the core oo-functions.
>  This may be a case where I've got too specific a need to warrant
> community interest but I'd think there might be other cases where such a
> method would prove handy.
> 
> Thoughts (other than the obligatory 'p1ss-off'?

not really an internals thing - generals list is better.

http://nl2.php.net/manual-lookup.php?pattern=token&lang=en

should get you what you need. :-)

> 
> --Tony

---

## #26415 — Tony Bibbs — 2006-11-08T01:01:54+00:00

URL: https://externals.io/message/26413#26415 · In reply to: #26414

Ah, `token_get_all()` might be what I'm after.

Thanks,

--Tony

Jochem Maas wrote:
> Tony Bibbs wrote:
> > […]
> 
> not really an internals thing - generals list is better.
> 
> http://nl2.php.net/manual-lookup.php?pattern=token&lang=en
> 
> should get you what you need. :-)
> 
> > […]
