Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108147 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93416 invoked from network); 15 Jan 2020 16:45:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Jan 2020 16:45:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BE5421804E6 for ; Wed, 15 Jan 2020 06:52:31 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE 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-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 ; Wed, 15 Jan 2020 06:52:30 -0800 (PST) Received: by mail-wr1-f54.google.com with SMTP id g17so16030726wro.2 for ; Wed, 15 Jan 2020 06:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=82jyVIrNlTU2XUOKHsCBIpN9uRSUHLp/Oe0nnDAbR/g=; b=H9UkbQ++G3aFtnQmyjqXYOpL1/GrDIdbJ89JuDLKEMV4XobXty/UktH1ezDp0yEZRx HzQ8B7goLgInKT+njeyRnsAAmGcaNXqMlFVS+U+KHiNquRcjSZlBRlTvfPzKOy4Gugq3 FHLxzIyktBnWPaexWZZTH+Dsc8EACjj/mxRvt9diG3pP3D/83AYFMpfhnIg6qxls3RtG dDz4pexF2gyTTM3lQKiBf5AR0zbIELjHrU5pQRVuW8Y5GuVu+w3u3wpM/sZgG4R77cj/ jdEfWNbAKIvPfLYpR9pErT5bvZs+9jw4HVEWtKLsIe2VWUadDiSkhrMA5yLs4V87W6yY WimA== 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=82jyVIrNlTU2XUOKHsCBIpN9uRSUHLp/Oe0nnDAbR/g=; b=XREGtjV/+rgeasGfTZ+pET9Et9H71iBpQ33uc9M7Z1nqyzjij0q7q7+KNhqLo3245R p6jMVTsx+6eT/eQM30am6h1zWupoY0siezz8HbRRUQw/tdemIs12MeD7/oiLfqqiQkP3 i3kx7z7q95654dFwL31JKRBUK+xOL591BDl7llbL0LfqXZyv8kpt3BoueCLRqb2cNpMo MK5z4bq431id88SXDlj7CFSm+l2ZUH9iOI2pI+zcQXGtY59sI2Cm5lHLbOf9mPdecTbQ 1c3TtW5r13xSF/0J3hyngpNPlydiU8KwbqRIZy9Dr+jazgtIDnw2FgQfiIfNBm+wi1N8 XAqQ== X-Gm-Message-State: APjAAAU4sdmkwK9Kapz/gPDLkWrHw3cVjOq+TlddbfC9g+Xagwye2alw f9eMWy76la0EXI0+oel+61K1UM16kjIM9kxyA8RhsOaymZ8= X-Google-Smtp-Source: APXvYqzfJuuErOwh/98D6mdkQpIY9d9KMAieAZkE/xQGPxNITFVk8M9fj6MHNulLhxi11O6XZWMNvIeYGwcCWHX/X70= X-Received: by 2002:adf:a285:: with SMTP id s5mr31496795wra.118.1579099947265; Wed, 15 Jan 2020 06:52:27 -0800 (PST) MIME-Version: 1.0 Date: Wed, 15 Jan 2020 15:52:16 +0100 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="0000000000006c0b01059c2edb10" Subject: ReflectionProperty::has/getDefaultValue From: kontakt@beberlei.de (Benjamin Eberlei) --0000000000006c0b01059c2edb10 Content-Type: text/plain; charset="UTF-8" Hi everyone, until now there was no way on ReflectionProperty to easily find out if a value has a default value and what that default value is. Essentially the way was indirectly through ReflectionClass::getDefaultProperties(). In combination with typed properties and Reflection use cases (for code generation for example) it is interesting to know when a property has no default value, because accessing it through ReflectionProperty::getValue($object) would otherwise throw a "property unitialized" error. I have added a PR adding these two functions and looking for more feedback from interested parties: https://github.com/php/php-src/pull/5071 This addition is small so that I believe an RFC is not necessary, given that it is more "missing functionality" that should have been there before greetings Benjamin --0000000000006c0b01059c2edb10--