Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72915 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38356 invoked from network); 5 Mar 2014 00:54:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2014 00:54:51 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.107 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.107 smtp107.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.107] ([108.166.43.107:36831] helo=smtp107.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/F0-32320-AD576135 for ; Tue, 04 Mar 2014 19:54:50 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp6.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id E6EB5989DC; Tue, 4 Mar 2014 19:54:47 -0500 (EST) X-Virus-Scanned: OK Received: by smtp6.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 7FA45989F9; Tue, 4 Mar 2014 19:54:47 -0500 (EST) Message-ID: <531675D6.1030203@sugarcrm.com> Date: Tue, 04 Mar 2014 16:54:46 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "Shuhei Tanuma (chobie)" , Marc Bennewitz CC: PHP internals References: <5307B1FE.1020604@marc-bennewitz.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [php6] OOP resources From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I prefer resource as It makes easier to implement bindings. > I've maintained several extensions. one of the library has 500 > approximates APIs. > Imagine considering complicated OOP interface is really nightmare... You don't have to do anything different there - you can still use the same API. With minimal effort, you can also make the API dual-purpose, i.e. foo_bar($foo, $bar) and $foo->bar($bar) would do the same. But it doesn't have to be that, you can also stay with foo_bar($foo, $bar) and have $foo as object. > To encapsulate resource data structure to object isn't bad idea. > but zend_list_insert is more convenient than > zend_object_store_get_object, isn't it? What would be the difference? It's pretty much the same API and macros can be added to eliminate any boilerplate code. See how it's done in intl, for example. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227