Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104250 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4458 invoked from network); 6 Feb 2019 18:46:55 -0000 Received: from unknown (HELO mail-yb1-f169.google.com) (209.85.219.169) by pb1.pair.com with SMTP; 6 Feb 2019 18:46:55 -0000 Received: by mail-yb1-f169.google.com with SMTP id y13so2618074ybr.7 for ; Wed, 06 Feb 2019 07:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D7lw/m6j/FTP3z+EU4yJz0a58ytknVXpCr10JS4VIeg=; b=do476WrYBfhklw9BqiILGSqwOTXhnKkCNQpGgRqErJN87H6RskBGlchhs8Uke0n9eG kN0VBr/oY/zmG8+HpYlNCRpDAhFZr7WIHvhUaxmRAYgEXDM0lucs4VVAQxeU6qX4uP0h bGzj2f0pNeHOVins2s2Q4L3eW/mGJVkLZrqmqmi8OtoVOhuAEH3BQ+R4GZFCnTp5a9Vg hiUx5Dk70uoaJP3JaEyMC+4U/IL85fLr6AiJjYvAtlt2QFae5Am6sXD8dHrPL6YV8T7M GnM0xwFs/Uirr8RMaO6pjxN6ulUx/FUYMBJaqU6cLaeTYdQvwvjJut28B2wQoxpevneg qnSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D7lw/m6j/FTP3z+EU4yJz0a58ytknVXpCr10JS4VIeg=; b=k+tA0gyTb08VChgTgXwf54dUqklZXYc6OO5E2KweqaFcmAeNFcInUXAfvo9ZlY/Xdv 2aQZu2wqLX+xn69CNfIEka53RMBldp5fJfBBlWBaB1zzLAf5NhFqxojikHWm+wbidKhP RQqo/fOXwqjSr2FlN0nliwhmWBx0ZUaFex2Hc0bmLDtLBRIRyInjhBpnSrfN79Ow1ChX bjNuR0SfWAqez13jB9KOuRGREUisJJaw/zwRuiShCE0fyXWUvm+WVyeHUHbvu6WR28Oe EbbY12OI7vyJjGXzuEgEu2LxzTs7AY69veWC0Qx7Zyi5eOCW5ikx2RSMaEh5uqtEuYll W2IQ== X-Gm-Message-State: AHQUAubxOSqZIccIk0Hx1O09Ll7jBCqCAypr6v0rPbgl76e5GBObd5Xj g56MTJrgudd+lNvdbPteto9qmEYAE3xamlyOli0= X-Google-Smtp-Source: AHgI3IZuTLngnRib0Xfik491oOne9tyxja1hHdUoWVDOQrtEoMKNvDMrsVupnKbrTrl7OLTVwR1w2hPi99mfvZGPlWw= X-Received: by 2002:a25:6884:: with SMTP id d126mr7228379ybc.417.1549466899568; Wed, 06 Feb 2019 07:28:19 -0800 (PST) MIME-Version: 1.0 References: <595b374c-bc4f-9b8a-0013-6485abbfb477@php.net> <41D0A782-E4E2-4B98-9C5D-174143DE9A76@gmail.com> In-Reply-To: Date: Wed, 6 Feb 2019 16:28:07 +0100 Message-ID: To: Rowan Collins Cc: Marco Pivetta , Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary="00000000000023de1c05813b60db" Subject: Re: [PHP-DEV] Re: [RFC] [VOTE] Typed properties v2 From: benjamin.morel@gmail.com (Benjamin Morel) --00000000000023de1c05813b60db Content-Type: text/plain; charset="UTF-8" > > We already have a function property_exists(). I don't know if it covers > the case you want, though. property_exists() returns whether the property is defined (as opposed to initialized) in the given class / instance: class A { > private int $id; > } > $a = new A; > var_export(property_exists($a, 'id')); // true So this would require a new function. On Wed, 6 Feb 2019 at 16:24, Rowan Collins wrote: > On Wed, 6 Feb 2019 at 15:21, Benjamin Morel > wrote: > >> Thanks for the pointer! I can see from this thread that another PR has >> been merged just over a month ago, to implement a ZEND_ARRAY_KEY_EXISTS >> opcode to overcome the performance penalty of array_key_exists(): >> https://github.com/php/php-src/pull/3360 >> >> Couldn't we broaden the scope of this opcode, or add a new one, to >> support object properties? >> > > We already have a function property_exists(). I don't know if it covers > the case you want, though. > > Regards, > -- > Rowan Collins > [IMSoP] > --00000000000023de1c05813b60db--