Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109747 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8490 invoked from network); 21 Apr 2020 12:13:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Apr 2020 12:13:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 655231804CD for ; Tue, 21 Apr 2020 03:44:59 -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-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 ; Tue, 21 Apr 2020 03:44:58 -0700 (PDT) Received: by mail-lf1-f50.google.com with SMTP id r17so10717454lff.2 for ; Tue, 21 Apr 2020 03:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Ubr7DnccMRRQlv2r8ZTN0q3R5TL0krzAz82Q6pIADjk=; b=DQE5/0IKZ/tp7xyebGfoCIkBqrJNnG/F+zhxu73VgcqTGEr/0sPt6ggXbGGWCVVf/2 KaTGluD5WekDFp9Sh/G7/6P7sl8uCKmMSeJilOEAt87ssQtriXaC9RuCLyPf70FBZF8/ OTafj1KuA/6gBNO7JYdLNjc2aSnVjSAzsctFaH1ogrj+FRJkwHodK3+yANgKsAuoNKg4 pNQ3mAJX7Hmtif/YczlZ0gd4dWg2jY8rmVp6ZcHfjrnlsxPcllVT1iTBPC02fUfK+Idv nMFu1elb9Z4wJ+9GBtSYc1pxZBAchghayt1i7JimctFokIlYAkU2bk3kKa1rSOYAlhbI a+kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ubr7DnccMRRQlv2r8ZTN0q3R5TL0krzAz82Q6pIADjk=; b=fnY1NSlcCw/rsO/2YYagrT+BbjsfBVHexEbgYnt5NfQ6rYFHbDk4BX9oumoZD7ZcnD Sy98D7iJ+qR9IAtZjvQMKgwRYTbg1F7WD10KyJqJerdkLZ2cSdIKaYfzPWZdSP7YQY5a CXIeEKku/BGKdWZBx+ER1I8y8tIeKrwLXdqoaXtOFIdlrKkf1NxDmZkZwTdOE6F25kTB 6QHEig1QFYD5TIisvZcvBaQuPor1dP7FqQULKMpNKrzI91EvIczVslctWlpAqwP/z8X1 aah4BpvtzXF7Uy6Ul204O+XM2MtffQ+03f4shELn+QLhICDaRlpEgAx8COFbrLuMzAza SJiA== X-Gm-Message-State: AGi0PubVoh6EHUkeeKN18KcigBfLABp9MUjpDzzEZikpTnMIz1w5EqPq 6upwCdGO8Z05smPLqHGehv25tJ4Z+wIWrjF46pAEElOFIp6sQQ== X-Google-Smtp-Source: APiQypJdZbQ26Wxn5Rbz96iXIQBcdG70WAXiufL4LA5cFVpKjKZd9NtpnSyZAHwRA+m41jH2dZgvIpyoRCvINeFjXeg= X-Received: by 2002:ac2:5f92:: with SMTP id r18mr13857319lfe.154.1587465896956; Tue, 21 Apr 2020 03:44:56 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 21 Apr 2020 12:44:41 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000e1972305a3cab462" Subject: Add get_resource_id() function From: nikita.ppv@gmail.com (Nikita Popov) --000000000000e1972305a3cab462 Content-Type: text/plain; charset="UTF-8" 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. Regards, Nikita --000000000000e1972305a3cab462--