Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74762 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17341 invoked from network); 5 Jun 2014 19:21:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2014 19:21:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=nicolai.scheer@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nicolai.scheer@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.178 as permitted sender) X-PHP-List-Original-Sender: nicolai.scheer@gmail.com X-Host-Fingerprint: 209.85.160.178 mail-yk0-f178.google.com Received: from [209.85.160.178] ([209.85.160.178:54661] helo=mail-yk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/50-14942-353C0935 for ; Thu, 05 Jun 2014 15:21:55 -0400 Received: by mail-yk0-f178.google.com with SMTP id 20so1209176yks.9 for ; Thu, 05 Jun 2014 12:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ezNk6RXsScnLF4joLvsBVecUh3FNTcU8VFva2TmDSr4=; b=NmSsZQUlzfkc15EfmYueHOksMJJqNrBpOx8E/WJbC0pEBVREwNhGfZdIUesjmcdpNz iVyT8y1xUYKQR3qs1vTvIpaLabYhETi0uUdkpRWxZ5Q185MzVNKmVV2uNbqb0tijzyRy XF1vYfY/tKngosrzctU69spBFcK9F17cTFzgF533zoDN0eo+sAF6tknbiqaoIv0NwAt6 mT0iMWAyfKciI3V6c+bVTis+jH+kLXZc6sjvEDCkm22Q0s2FR0oy3YMBReoOr6NhrI5H yWJ+AykKpDNEB0O/OE4q2iv5R/nd3UCVx8mWwvixlufS2Bs6hbSVHcUzY1aF3SFiTT1l bRTg== MIME-Version: 1.0 X-Received: by 10.236.17.194 with SMTP id j42mr38865310yhj.138.1401996112533; Thu, 05 Jun 2014 12:21:52 -0700 (PDT) Received: by 10.170.88.215 with HTTP; Thu, 5 Jun 2014 12:21:52 -0700 (PDT) In-Reply-To: <1401917648.2282.175.camel@guybrush> References: <1401917648.2282.175.camel@guybrush> Date: Thu, 5 Jun 2014 21:21:52 +0200 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c1e2a843a03b04fb1ba8d9 Subject: Re: [PHP-DEV] zend_API.c - missing zend_update_property_resource From: nicolai.scheer@gmail.com (Nicolai Scheer) --001a11c1e2a843a03b04fb1ba8d9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi! On 4 June 2014 23:34, Johannes Schl=C3=BCter wrote= : > On Wed, 2014-06-04 at 21:52 +0200, Nicolai Scheer wrote: > > Hi, > > > > is it by itention, that there is no zend_update_property_resource in > > zend_API.c (as of 5.5.12)? > > The reason most likely is that nobody needed it, yet. I also don't see > the need right now: > > * resources are handled as zvals, thos can be passed by > zend_update_property(). The other are just wrappers creating the > zval first. > Of course it is no big deal to use zend_update_property and create the zval myself :) > * Usage of resources is discouraged, instead of a resource use an > object (extend zend_object to store pointers etc.) > Didn't know that usage of resources was discouraged... Nearly all my knowledge comes from Sara's great book (btw. if you read this Sara, I'd love to see and buy a refreshed version!) and my own field tests. When you say "use an object", do you refer to the way described in [1]? From what I've read so far, this way sounds more complex than just registering a resource. Could you elaborate a bit on the rationale behind this recommendation? > > What is the usual and official way to add such a function and what can = I > do > > to make it happen? > > The typical case that a developer who has a need creates a patch and > depending on impact and the developer's brevity pushes it, sends it to > the ist or creates an RFC. Developers without karma can only do the > later (or now somebody with karma) > > > If such a thing was added, would this be considered an api change - i.e= . > > the zend api number would be adjusted? > > Edge case. By strict rules yes, but there are enough previous examples > where we added APIs. Depends on brevity and need as above ;-) > > johannes > > Thanks for the detailed info! Greetings Nico [1] http://www.phpinternalsbook.com/classes_objects/custom_object_storage.html --001a11c1e2a843a03b04fb1ba8d9--