php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76915 RefrectionFunction not return isDeprecated for "each"
Submitted: 2018-09-21 14:17 UTC Modified: 2018-09-29 12:33 UTC
From: mitko at edabg dot com Assigned: nikic (profile)
Status: Wont fix Package: Reflection related
PHP Version: 7.2.10 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mitko at edabg dot com
New email:
PHP Version: OS:

 

 [2018-09-21 14:17 UTC] mitko at edabg dot com
Description:
------------
---
From manual page: http://www.php.net/function.each
---
ReflectionFunction for "each" internal function doesn't return isDeprecated for php 7.2.10.


Test script:
---------------
<?php
$refFunc = new ReflectionFunction('each');
if ($refFunc->isDeprecated())
  echo "Deprecated\n";
else	
  echo "NOT Deprecated\n";


Expected result:
----------------
Deprecated

Actual result:
--------------
NOT Deprecated

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-09-21 17:58 UTC] cmb@php.net
-Summary: RefrectionFunctio not return isDeprecated for "each" +Summary: RefrectionFunction not return isDeprecated for "each" -Status: Open +Status: Verified -Assigned To: +Assigned To: nikic
 [2018-09-21 17:58 UTC] cmb@php.net
The problem is that the function is not marked as ZEND_DEP_FE[1],
since it is not desireable to raise a deprecation notice for each
each() call.

Nikita, is there a viable fix, or should we mark this as WONTFIX?

[1] <https://github.com/php/php-src/blob/php-7.3.0RC1/Zend/zend_builtin_functions.c#L247>
 [2018-09-21 19:31 UTC] nikic@php.net
We could add a check in reflection that checks if the function is "each" specifically. But I don't think introducing such a hack is worthwhile.
 [2018-09-29 12:33 UTC] nikic@php.net
-Status: Verified +Status: Wont fix
 [2018-09-29 12:33 UTC] nikic@php.net
Closing this as won't fix, I don't think we want to do the special casing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 06:01:30 2024 UTC