Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60686 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93475 invoked from network); 29 May 2012 03:10:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 May 2012 03:10:30 -0000 Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 74.115.204.80 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 74.115.204.80 migration-relay.domainlocalhost.com Received: from [74.115.204.80] ([74.115.204.80:32133] helo=relay-hub206.domainlocalhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/F1-13113-32E34CF4 for ; Mon, 28 May 2012 23:10:29 -0400 Received: from MBX202.domain.local ([169.254.149.228]) by HUB206.domain.local ([192.168.69.6]) with mapi id 14.02.0283.003; Mon, 28 May 2012 23:10:24 -0400 To: "internals@lists.php.net" Thread-Topic: zend_compile_string() usage within code Thread-Index: Ac09R//ufjQ8HahrSJWX7nQbLixWvg== Date: Tue, 29 May 2012 03:10:24 +0000 Message-ID: <9570D903A3BECE4092E924C2985CE48558639884@MBX202.domain.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.64.22] Content-Type: multipart/alternative; boundary="_000_9570D903A3BECE4092E924C2985CE48558639884MBX202domainloc_" MIME-Version: 1.0 Subject: zend_compile_string() usage within code From: cpriest@zerocue.com (Clint Priest) --_000_9570D903A3BECE4092E924C2985CE48558639884MBX202domainloc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Has anyone ever used the zend_compile_string() within the c code for compil= ing internally created php? Is it frowned upon or has it never come up bef= ore? In writing the accessors code I have several parts that are effectively jus= t mimicking what a simple zend_compile_string() would accomplish in a singl= e line. It may be just as efficient as writing the zend_do_begin_variable_= parse() ... etc lines myself but would have the added benefit of changing a= s the language changed as well. More specific example: Automatic implementation for a getter, would be something like this: public $a { get; /* Equivalent to "return $this->__a */ set; /* Equivalent to "$this->__a =3D $value; */ } I would simply CG(active_op_array) =3D zend_compile_string("return $this->_= _a;", ...); Thoughts? -Clint --_000_9570D903A3BECE4092E924C2985CE48558639884MBX202domainloc_--