Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105844 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23726 invoked from network); 6 Jun 2019 10:54:13 -0000 Received: from unknown (HELO mail-it1-f193.google.com) (209.85.166.193) by pb1.pair.com with SMTP; 6 Jun 2019 10:54:13 -0000 Received: by mail-it1-f193.google.com with SMTP id n189so1747495itd.0 for ; Thu, 06 Jun 2019 01:05:34 -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=3i8W/6D+TMEizig4CAuCf5MQItspbyVmszNJr+X0uS8=; b=NeOfOWQ5sn97cNa+MSecj0N9ysvczj48aEBAvCLS+navKrZQLFp4Z0KofOnXSv84YB rJmjM2YztB4C2hsKRs7C7+F6i4uesu57aijkFA8VhT0SgV++X+3Esn2WYCgj2A87JrGC D3ZLdhccH0C8gYUK600fyA1Hg5zP528onXAQ06nNPoyG4gUafgg3IQzdfhrV89n5QRhE 3QbiuNVdvjp3Ef6F0lgAObn/jhvhLLiHANuTSK4PDyimvctHiDhWy0jNIV0uhVMptKhJ GiKK7AbqwbDUQhJCMWFTSYrdYkgaLN6Axf0Qykw6nGfaUjt4m/3xoxZ76yA619RuQEFy uo7g== 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=3i8W/6D+TMEizig4CAuCf5MQItspbyVmszNJr+X0uS8=; b=X6Kv9Vu9OTEgC9+F0EQFuH9KS71Gd8zdyYo9apPEphMthRuhb9a0I5ovZHfi/iLd+L H4RlhfBhvN9BhlmvrOhM1PhXYM8zmn2Zd1asyQF219/PgMQB/fXd2XgzV5C8gJrox4T9 WR8BxPgQBZjJAyucnWb4B8hxJns1bVVngiluzXLGJEU8yQViIHRKSk/dRFNZqfm+BqJ8 N6/YyOBvehfbpcWuq+7418/VkQOtbYpNco1DLItUqvkOu2fAIYu+/qC/DrqZuaU8FM+5 vJEHFo0LqLEqbjFxasfF2QiBeLqA2IVGJPT/4Pyp5k6rfehGtSb8glBFZUpngoyZsF+8 o2qw== X-Gm-Message-State: APjAAAXXSPBBSh7DnJC6+yzoCtKeTdHNNWTQj421BwgS19Ha6Lc/WUTL KGeLFuMapgnKNO7EyfyJFUCH0yn5ajDDM4gZgZw= X-Google-Smtp-Source: APXvYqxbYSJ+jkmBj/8nOKNuBvx+qyJW4k62bUsz4csxb8mnQUa1z0q6IGv6eW32buUlE6LJJa8Wa8fRwqoT1sTx/24= X-Received: by 2002:a24:1710:: with SMTP id 16mr16170898ith.116.1559808333439; Thu, 06 Jun 2019 01:05:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 6 Jun 2019 10:05:20 +0200 Message-ID: To: Nikita Popov Cc: Benjamin Morel , Steven Wade , PHP internals Content-Type: multipart/alternative; boundary="000000000000a1e853058aa32d70" Subject: Re: [PHP-DEV] Add get_mangled_object_properties() From: ocramius@gmail.com (Marco Pivetta) --000000000000a1e853058aa32d70 Content-Type: text/plain; charset="UTF-8" Provided feedback on the patch: looking good for me, not sure of this needs an RFC or not. On Thu, Jun 6, 2019, 09:53 Nikita Popov wrote: > On Tue, May 14, 2019 at 4:45 PM Nikita Popov wrote: > >> 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 >> > > Any more feedback on the addition of get_mangled_object_vars()? > > Regarding the typehints, I've added an "array" return type for > get_object_vars() in PHP 8 ( > https://github.com/php/php-src/commit/252216b2ded7d3808e2a909bfea1e805ee17cde5) > and will do the same for this function. The argument type is still blocked > on some preparatory work. > > Nikita > --000000000000a1e853058aa32d70--