Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108148 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43467 invoked from network); 15 Jan 2020 20:53:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Jan 2020 20:53:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D7100180558 for ; Wed, 15 Jan 2020 11:00:13 -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,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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-yw1-f46.google.com (mail-yw1-f46.google.com [209.85.161.46]) (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 11:00:13 -0800 (PST) Received: by mail-yw1-f46.google.com with SMTP id z7so11485845ywd.4 for ; Wed, 15 Jan 2020 11:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AytXiAqIpq1sZNgVEy7KHjnMhHlvf8CyrSa0gVkTnjI=; b=vSwWXF8hQiZqoWub3PAEfP1UohePut3VV51qwOe9e8gi6am1Y6jrHYbVoyCaVEoA4k TN86y2wOrTnmuhF6LkJfTlKBrQ/WnBEZGH6Q7yU2ilrQFdb2a9MTa6qJRsbfWADSUgaT Wln05Znu/jQuDqzcidVFe+NoUAXu73iYgy7IITrImF+PDmWW11t453AQevXBXX8vdCIW 9g2QAVqMwB4VIsm7k5mM5HWhBPuyOTmyS4KRwzmLtysR/twBgj1vmbUTtOFC6JcATfEd XPotGRzPaK6/fqbXpCHpbUghRB3YlF6w3ffQ3VV9LGo3hSATYPUIWGorawsGZ6yHNh5h 0ZaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AytXiAqIpq1sZNgVEy7KHjnMhHlvf8CyrSa0gVkTnjI=; b=RYqsKToWfokrKyJ3T5o89fTD3AVCyRf7xMPqpzWpk9ADh8ciGsivmr/JAPagdXKKyK 0l8LvlVFr0FQDOqj9jEAlIVPEcYh9X+zrhjveBGzIHNK+jgUM/PDiAmxcD8zFY2LuXOt 72EQlKxyCQBABJI9E1LWk32A6eSFrUXlji4vuR1bTZDEXekLNn4mKk+dORHqizWYOCKh 12oscBIqpDwJ/04dVSfu6qKijpyDBR6t3AN/+0K6KU720ydihb6W2/cL6c3Vw0w57n6s Gy2QKEtjpI5Or3hGzEcfFXRAg9NSzQ3V5NgF5EhQQxyrsAqGcdSS6UzRoi4wTHhQaQ0K oAhg== X-Gm-Message-State: APjAAAXZY7cGHilo71eMhqXWwS4f2Zyx6qJA6/ccK6FSOsii9Qa1gttp u4q1XYiMjSB40TWaw+RDq38eEVmdHTXF+g== X-Google-Smtp-Source: APXvYqwfif/K6/jIazLx7nH++KDapEcomtpyLzpIsZjk7UXB8GEbisHbmKoeoRxz6kU4RkJ2Aj8Hbg== X-Received: by 2002:a81:9e49:: with SMTP id n9mr22406038ywj.234.1579114812686; Wed, 15 Jan 2020 11:00:12 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:80fe:57d:ecbc:e1c1? ([2601:c0:c680:5cc0:80fe:57d:ecbc:e1c1]) by smtp.gmail.com with ESMTPSA id m30sm8705534ywh.12.2020.01.15.11.00.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jan 2020 11:00:11 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Wed, 15 Jan 2020 14:00:10 -0500 Cc: PHP Internals Content-Transfer-Encoding: 7bit Message-ID: References: To: Benjamin Eberlei X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] ReflectionProperty::has/getDefaultValue From: mike@newclarity.net (Mike Schinkel) > On Jan 15, 2020, at 9:52 AM, Benjamin Eberlei wrote: > > 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 +1. I have previously run into a use-case for this. -Mike