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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 + 18 = ?
Subscribe to this entry?

 
 [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: Sun May 19 14:01:32 2024 UTC