Re: Add PHP "native" class in extension

From: Date: Thu, 07 Sep 2000 07:30:57 +0000
Subject: Re: Add PHP "native" class in extension
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-32497@lists.php.net to get a copy of this message
> Is it possible to add a PHP "native" class through the extension > mechanism? What I mean by "native" is that the class is built into PHP, > so a programmer can do something like this (without having a .class or > .inc file): > > <? > > obj = new nativeClass; > > obj->method1 (...); > > ?> Sure see ext/com and ext/java for examples. > > On a similar note, how do I write an extension function which returns an > object (with data and function encapsulated of course)? I know it can > be done, since the DomXML extension does something like that. Just > wondering if there is any good documentation on how to do it. The dir() function returns a class as well. I'd just follow the example ext/standard/dir.c -Rasmus

« previous php.dev (#32497) next »