Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105704 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70291 invoked from network); 14 May 2019 17:40:01 -0000 Received: from unknown (HELO mail-lj1-f173.google.com) (209.85.208.173) by pb1.pair.com with SMTP; 14 May 2019 17:40:01 -0000 Received: by mail-lj1-f173.google.com with SMTP id m20so2823984lji.2 for ; Tue, 14 May 2019 07:45:41 -0700 (PDT) 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=rP/o9mYU1xE2e85WFefjElIYGlXuNd5vobZX4IoHhho=; b=CTJr+4mV9EB9T7IikLd8Aizpl80ycaZfPOsNJX3VCfplYp6LEETX8VvrBqN2sXy7px EgiWO9pLjGQgOopdtfr7sYdnPe6IPGdlIudPL3L/AgQBxN1upt88NbpJNIMbBEsoOd5U 8MVTzrgTSSV63mnDwETiZeI0lfqYxU8c8ez/ONhDBUQM3Vo4lRR7vq+TojGtClbT2uZM An6kjNDcB82uYL/F+fh/DXomfAT2qz+bhcaLs1WPQBwSMjqc7fBzPylzUhAkUN8YY5ja YwGMu6AXhtLyyGgUWsQ2KqOi1PbbRTL82dwPq7vxFwW/8o010QwPp0IjabKIjCIyAWBv dczw== 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=rP/o9mYU1xE2e85WFefjElIYGlXuNd5vobZX4IoHhho=; b=G2Q/gQyrLuIodqZHjwcBMf/IkO20eygOxtTSSWK/t6HqnGSlaMfqYO3YUDaS04jZpO DDnQcv3QYTLKN0X6Tbns4F5v2vDa9subI3hNPH2BOwygCwcZh/0UeHY84OWkdHMDBVAr pML/32+Pxmz/i+OVxbzY/mmN5HFbEXd0RT1ryPdu/MpuYwBux7e0YW/CdohGb5r94hr0 1MYFU4kgl78Oqi76kpObmebWDYKRTfz1DnFx200TFNG7FXqDBsVfHzwqja5D+p8VN8QU HYp25F82acONUPM6inCIuus4yFRZzu1WizFhCxKmSWz90Xs4r2tmzc3J2lcaj36srTvl OzNw== X-Gm-Message-State: APjAAAVoKCL+7XdMPk/azHf/gcEOZnBCFiIptIGMJ6q4wmJA/pWNC8dC k5Epmvi4uMLpGFoB1txGWeHw9esVGqlNt4pMI9+YwMhY X-Google-Smtp-Source: APXvYqzNWRique1R8/pfU2suA8iXc/sgQv5oTO2VpSDk/fMfCVsnCMZB4sgIDOmL4dqTmINxAMSrRBIKuAO979neSmU= X-Received: by 2002:a2e:81d0:: with SMTP id s16mr17018158ljg.145.1557845140507; Tue, 14 May 2019 07:45:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 14 May 2019 16:45:24 +0200 Message-ID: To: Marco Pivetta Cc: Benjamin Morel , Steven Wade , PHP internals Content-Type: multipart/alternative; boundary="0000000000003710850588da166d" Subject: Re: [PHP-DEV] Add get_mangled_object_properties() From: nikita.ppv@gmail.com (Nikita Popov) --0000000000003710850588da166d Content-Type: text/plain; charset="UTF-8" On Tue, May 14, 2019 at 4:37 PM Marco Pivetta wrote: > > On Tue, May 14, 2019 at 4:29 PM Benjamin Morel > wrote: > >> I like the explicitness of the proposal, but only if performance is as >> good >> as (array) cast. One of the reasons we use casting to array in libraries >> is >> not only to access all properties at once, but also because it's fast as >> it's implemented as an opcode and not a function call. Would this function >> come with its own opcode, like strlen() / gettype() / etc.? >> >> Ben >> > > Indeed. Besides that, this is a good chance to have an explicit `object` > parameter type. > > @Nikic is the return type also `array`, according to reflection? > I'd prefer not to add either of them until the question of type annotations on internal functions is solved more comprehensively in PHP 8. In particular adding an "object" type will currently add additional cost to the call. I hope that we'll solve this problem in PHP 8 and annotate functions with types in a comprehensive way (including existing functions, like get_object_vars). Nikita --0000000000003710850588da166d--