# Creating a class in a php extension

- Thread: https://externals.io/message/30266
- Original archive: https://news-web.php.net/php.internals/30266
- Started by Jordan Wambaugh on 2007-06-19T17:53:48+00:00
- Messages: 6
- 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

---

## #30266 — Jordan Wambaugh — 2007-06-19T17:53:48+00:00

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

I've just recently begun writing PHP extensions for the first time. Sara 
Golemon's article on extension development has been a priceless resource for 
me, but I haven't been able to find any documentation on how to define a 
class, give it methods and properties etc within an extension. Is there any 
documentation on this? If not, can someone point me in the right direction?


Thanks,
-- 
Jordan CM Wambaugh
Software Engineer
ForRent.com
Dominion Enterprises
jordan.wambaugh@forrent.com
AIM: martamius
Phone: 757-351-8300

---

## #30267 — Stut — 2007-06-19T18:14:30+00:00

URL: https://externals.io/message/30266#30267 · In reply to: #30266

Jordan Wambaugh wrote:
> I've just recently begun writing PHP extensions for the first time. Sara 
> Golemon's article on extension development has been a priceless resource for 
> me, but I haven't been able to find any documentation on how to define a 
> class, give it methods and properties etc within an extension. Is there any 
> documentation on this? If not, can someone point me in the right direction?

Buy the book: Extending and Embedding PHP by Sara Goleman.

It covers classes and a whole lot more. Required reading for anyone 
developing PHP extensions.

-Stut

-- 
http://stut.net/

---

## #30268 — muquaddim — 2007-06-19T18:17:47+00:00

URL: https://externals.io/message/30266#30268 · In reply to: #30266

I think you have to buy the Sara's Book
Very good book.

---

## #30269 — Pierre — 2007-06-19T18:19:44+00:00

URL: https://externals.io/message/30266#30269 · In reply to: #30268

> I think you have to buy the Sara's Book

Or/and read the sources. PHP or PECL are full of extensions
implementing classes :)

--Pierre

---

## #30277 — johannes@php.net — 2007-06-19T23:09:00+00:00

URL: https://externals.io/message/30266#30277 · In reply to: #30266

Hi Jordan,

next to the book, which is a good reading there are some lsides from
Marcus at talks.somabo.de (look for "Code Camp" or something like that)
which give an introduction, but well, slides are always made for being
explained during a talk :-)

johannes


> I've just recently begun writing PHP extensions for the first time. Sara 
> Golemon's article on extension development has been a priceless resource for 
> me, but I haven't been able to find any documentation on how to define a 
> class, give it methods and properties etc within an extension. Is there any 
> documentation on this? If not, can someone point me in the right direction?
> 
> 
> Thanks,

---

## #30278 — Gregory Beaver — 2007-06-19T23:18:26+00:00

URL: https://externals.io/message/30266#30278 · In reply to: #30266

Jordan Wambaugh wrote:
> I've just recently begun writing PHP extensions for the first time. Sara 
> Golemon's article on extension development has been a priceless resource for 
> me, but I haven't been able to find any documentation on how to define a 
> class, give it methods and properties etc within an extension. Is there any 
> documentation on this? If not, can someone point me in the right direction?

Hi Jordan,

The extensions in ext/ and pecl/ (particularly the simple ones like
pecl/spread
http://cvs.php.net/viewvc.cgi/pecl/spread/php_spread.c?view=markup)
demonstrate the process.  I find http://lxr.php.net extremely useful for
quickly finding the connections in source code.

Greg
