Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110128 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17178 invoked from network); 11 May 2020 11:27:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 May 2020 11:27:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DD2E81804E2 for ; Mon, 11 May 2020 03:04:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 11 May 2020 03:04:12 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id v5so2893334lfp.13 for ; Mon, 11 May 2020 03:04:12 -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; bh=zsOj8B4fwz9IPKbUOwylkfwTy6XBupSF0ui4YJ4Z3VM=; b=Gl0cMG7Cep07Bt5QXHqnagiYxirkh7/1qwxCTcdr5ZV35k8WTD5JhFUlHNyNNrG/1a HGNx5Ywl+42u+m2ymFAgCVPY/8T6dpyot3l9zHJwTAC1O3S1wdE7GR3pL+FmwQStE9No +xwC8Pr1Y0NaMVjTBG+npEZ86Sj40TatY0CztAG/f/LEjFHZp8qL86F0JnxtNXOrzFAM j//YsTpPVy+Z9RXD/Lc5KdJi2C28XX73944bDmse6nXQP2yWxbAq35OL1DnJJYoAwlG6 wfw21nzcC6hTBU6nPAYEV6BFqRaMB5AqOZm5tz3Q59eqZW6zz0VfiXU0oAw7SouaCRU7 qrfQ== 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; bh=zsOj8B4fwz9IPKbUOwylkfwTy6XBupSF0ui4YJ4Z3VM=; b=szdbrE4ankCWE52bDfgI3xD2wsQtFJu0CyJyum6gHQObmtpOg0kdGgRoaz9MKOX5PR FqbXXlY3QaAiQa/db3BXjAbWl9OfO+ZEyh6VQ1b/8R201/OVXl6yg3jv6AfzcCaiXMkv X7IQxpoARQCkNQeeifWfGw6zkBn56QYkE28xCLYFT64g5S1Ub2TIi8bExbZuybLAogcu j0AUt0zufhMwe55cnGQqKuan9DwQuGEgw4Tnxhf1L6iaauyQInsifsLueJxFSI1KNyi2 qHaj4IoTJ2vR+DEIVNHvhDtncPVLz5B6PJvwmxiL7DbwBDYUnpKzlx21Bw/njOZErVrd okxA== X-Gm-Message-State: AOAM532WCk2tPXRr3SMvtL9fY0Hk3Ds3aS9HMcVvCkcde7H2u7AHJxe/ rlCihrwW1+c0aithDTgsqYFr5STlvX4YNrkM349+QNB/ X-Google-Smtp-Source: ABdhPJwrvTAYhGjl8EQLI1QRbJKtQZ/owI0oyIqL9eFbT96FLyLh45GstOdGKkiTCH+gEvHkY1+r+Xve1CDXZc9iI2U= X-Received: by 2002:a05:6512:686:: with SMTP id t6mr10991698lfe.154.1589191446540; Mon, 11 May 2020 03:04:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 11 May 2020 12:03:50 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000a6b5ff05a55c7790" Subject: Re: Add get_resource_id() function From: nikita.ppv@gmail.com (Nikita Popov) --000000000000a6b5ff05a55c7790 Content-Type: text/plain; charset="UTF-8" On Tue, Apr 21, 2020 at 12:44 PM Nikita Popov wrote: > Hi internals, > > This originally came up in the "Stricter type-checks for > arithmetic/bitwise operators" thread. I would like to add a > get_resource_id() function, which does the same as an (int) $resource cast, > just in a more explicit way, that does not require the reader to be > familiar with PHP language minutiae. There is no plan to deprecate or > remove the (int) $resource form. > > This is similar to the recently added get_mangled_object_vars() function, > which is (about) the same as an (array) $object cast, but makes the > intention of working with mangled properties clearer clearer. > > The get_resource_id() name is based on the already existing > get_resource_type() function. > > The implementation is trivial and available at > https://github.com/php/php-src/pull/5427. > As there haven't been objections here and reception on the PR positive, I went ahead and merged this. Nikita --000000000000a6b5ff05a55c7790--