Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101301 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5236 invoked from network); 11 Dec 2017 03:00:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2017 03:00:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=andreas@dqxtech.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andreas@dqxtech.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dqxtech.net from 209.85.215.51 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.215.51 mail-lf0-f51.google.com Received: from [209.85.215.51] ([209.85.215.51:33641] helo=mail-lf0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/55-53433-0D4FD2A5 for ; Sun, 10 Dec 2017 22:00:32 -0500 Received: by mail-lf0-f51.google.com with SMTP id 74so17562461lfs.0 for ; Sun, 10 Dec 2017 19:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=Ge63N1nXZo2tRiNn2jVK1p5xCMNTlbavW9LCSn7vqsI=; b=Zg3oaLatgfPKfVanRuebqLlCiyMy4wzDBTuoTMbtDR1OQnu9vYeO77HO63TBxfzL6D 3YHZvRHxRLufn8KxpJASdyHeOfmf4WN4BTNVqfm4vvrAlctV+MkmI+54/T7+oOH19tWR f1E9ajjuEXb+n4f2kNA7mvNNio6NYyQZVe2NZHDBhyIDtLJx2qTt1dgNQqoKCMs854Nd wNST7JZksxkCV8VGe5yBEbjbva+YvYBYGQOiddumCGPWsh//c4Cfqzear9EEiDyXsQbu akI2fX/UZq8xoAAJQeTIEUVz5tZgK9ZjbPI/VJWoBNeM8uWkAHKgkTxp6TQS3SzIbewP sIxQ== 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=Ge63N1nXZo2tRiNn2jVK1p5xCMNTlbavW9LCSn7vqsI=; b=UsNeQnroDExHEl9V2DLGy+6vGq0gk5ay46UGhbd2SVflpx/5+AHCYWTUsHmr3X+U2h tqXudqppr13kIC8nnQsWN1sM4vvDWNHbT0QA46u7gF3+BTT4l9t9KJcZY/nE/YHxMlVO y0FHsPKx1U9T6HucGyMcDE3RoJ8xP4sZiohHAF7Cw4F8rNXnCWTFfmfGLJjCIkjrQRvX 3NtlkOk/Mh4Xoy1AhpstFKycyyV+J1RnM/6HGJrOQnjrs9U7/DTsOIpxsZpIH8TzgjA1 BW++GNGKkYC2jlL+D/7je+Tn6RT8ZNOnEc0gCbMtn3PHwNiQPn7uVjI7p0hpmDMKBIIE y2nQ== X-Gm-Message-State: AJaThX7TumMInz6BU28MUqoyrsZRKslbDFesnGiL3Rt9DtRto2HVc1j+ 0/nQIVNnDlNqsJY8nI0EE88bgboH X-Google-Smtp-Source: AGs4zMaAZI41YRtKGUsU8MIYmEwMOuWsazv9S3KJREFTfUiNLZQvT7QmaYqxh1Bgz8Y28PWPVBnE4Q== X-Received: by 10.25.23.207 with SMTP id 76mr16283340lfx.123.1512961228523; Sun, 10 Dec 2017 19:00:28 -0800 (PST) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com. [209.85.215.48]) by smtp.googlemail.com with ESMTPSA id p25sm2520655lfg.49.2017.12.10.19.00.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Dec 2017 19:00:27 -0800 (PST) Received: by mail-lf0-f48.google.com with SMTP id j124so17543085lfg.2 for ; Sun, 10 Dec 2017 19:00:27 -0800 (PST) X-Received: by 10.46.23.156 with SMTP id 28mr17709128ljx.3.1512961227429; Sun, 10 Dec 2017 19:00:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.170.16 with HTTP; Sun, 10 Dec 2017 19:00:06 -0800 (PST) Date: Mon, 11 Dec 2017 04:00:06 +0100 X-Gmail-Original-Message-ID: Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Reflection API: Add ::getFullName() method. From: andreas@dqxtech.net (Andreas Hennings) I propose a new method ::getFullName() for all methods that implement \Reflector. (I would add it to the \Reflector interface, but this would be a BC break.) The full name would be, depending on the type: function: "str_replace()", "Acme\foo()". class: "Acme\Animal\Cat", "stdClass". method: "Acme\Animal\Cat::meow()". property: "Acme\Animal\Cat::$color". etc. I don't know if we can cover all reflection API classes in a meaningful way. E.g. for ReflectionObject, the full name would be the same as for the class, otherwise it would get complicated. Currently the ::__toString() and ::export() return something else, which is not really useful. The goal is to have something that is different for different items. E.g. a class and a function with the same name need to have a different "full name", hence the added "()" for functions and methods. As a rule of thumb, the "full name" is what one would put after a @see tag in phpDoc, but without the leading "\\". For consistency with the rest of PHP and reflection API, we should use QN and not FQN as return value. Related: I started another thread proposing a ::getHash() method. I originally though to propose the two things in the same thread, but I now think they should be discussed independently.