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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC