Bug->Req #81297 [Opn]: Improve __toString() return for internal deprecated functions
| From: | cmb@php.net | Date: | Mon, 09 Aug 2021 12:08:25 +0000 |
| Subject: | Bug->Req #81297 [Opn]: Improve __toString() return for internal deprecated functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235706@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81297&edit=1
ID: 81297
Updated by: cmb@php.net
Reported by: herobrine135111 at gmail dot com
-Summary: Incorrect __toString() return for internal
deprecated functions
+Summary: Improve __toString() return for internal deprecated
functions
Status: Open
-Type: Bug
+Type: Feature/Change Request
Package: Reflection related
PHP Version: 8.0.8
Block user comment: N
Private report: N
New Comment:
> So while the punctuation might be better (an additional space
> after the colon, say), the words are in the right order.
Right. Would be trivial to fix[1], but I don't see it as a bug.
[1] <https://github.com/php/php-src/blob/php-7.4.22/ext/reflection/php_reflection.c#L742>
Previous Comments:
------------------------------------------------------------------------
[2021-07-26 23:09:18] a at b dot c dot de
"internal" and "deprecated" are flags describing the status of the function, and
"libxml" is name of the containing extension.
This isn't new with 8.0; 7.4 described is_real() the same way: "<internal,
deprecated:standard>".
So while the punctuation might be better (an additional space after the colon, say), the words are
in the right order.
------------------------------------------------------------------------
[2021-07-26 07:49:16] herobrine135111 at gmail dot com
Description:
------------
ReflectionFunction and ReflectionMethod __toString() method for internal deprecated functions
returns strange looking <internal, deprecated:libxml> instead of <internal:libxml,
deprecated>
Test script:
---------------
<?php
// libxml_disable_entity_loader is deprecated in PHP 8
echo (new ReflectionFunction('libxml_disable_entity_loader'));
Expected result:
----------------
Function [ <internal:libxml, deprecated> function libxml_disable_entity_loader ] {
- Parameters [1] {
Parameter #0 [ <optional> bool $disable = true ]
}
- Return [ bool ]
}
Actual result:
--------------
Function [ <internal, deprecated:libxml> function libxml_disable_entity_loader ] {
- Parameters [1] {
Parameter #0 [ <optional> bool $disable = true ]
}
- Return [ bool ]
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81297&edit=1