# Private data in C/C++ generated classes for Php - example?

- Thread: https://externals.io/message/22113
- Original archive: https://news-web.php.net/php.internals/22113
- Started by Andrew Mather on 2006-03-05T10:29:57+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

---

## #22113 — Andrew Mather — 2006-03-05T10:29:57+00:00

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

Further to my earlier mail, does anyone have/know of a 
working example that demonstrates private data held in
C/C++ and encapsulated within a Php/Zend object for
storage, exposing a Php class, per George Schlossnagle's
recommendation/example?

Cheers,

Andrew.

---

## #22114 — Hartmut Holzgraefe — 2006-03-05T10:44:08+00:00

URL: https://externals.io/message/22113#22114 · In reply to: #22113

Andrew Mather wrote:
> Further to my earlier mail, does anyone have/know of a 
> working example that demonstrates private data held in
> C/C++ and encapsulated within a Php/Zend object for
> storage, exposing a Php class, per George Schlossnagle's
> recommendation/example?

(warning: shameless plug ahead as usual)

not per Georges example but CodeGen_PECL has support for this

it is not docuemted yet but there is an example in its CVS
repository that shows how to create a class with payload data
which is also used as a testcase:

http://cvs.php.net/viewcvs.cgi/pear/CodeGen_PECL/docs/examples/class_payload.xml?view=markup

-- 
Hartmut Holzgraefe, Senior Support Engineer                            .
MySQL AB, www.mysql.com

Join me at MySQL's 2006 Users Conference, April 24-27!
http://www.mysqluc.com/

---

## #22115 — Marcus Boerger — 2006-03-05T11:28:34+00:00

URL: https://externals.io/message/22113#22115 · In reply to: #22113

Hello Andrew,

  nearly all classes in ext SPL have payload fields. Also SimpleXML, PDO,
SQLite, MySqlI, DOM and a bunch of other extensions have.

To add another shameless plug, all my extension writing talks contain an
example available in full source code that shows it. If you take the last
one, PHP Code Camp, it is slide 62. See http://talks.php.net

Sunday, March 5, 2006, 11:29:57 AM, you wrote:

> Further to my earlier mail, does anyone have/know of a 
> working example that demonstrates private data held in
> C/C++ and encapsulated within a Php/Zend object for
> storage, exposing a Php class, per George Schlossnagle's
> recommendation/example?

> Cheers,

> Andrew.



Best regards,
 Marcus
