|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76736 Tidy's Reflection arginfo is wrong for some global functions
Submitted: 2018-08-13 13:16 UTC Modified: 2020-04-16 10:39 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tysonandre775 at hotmail dot com Assigned: nikic (profile)
Status: Closed Package: Tidy (PECL)
PHP Version: 7.1.20 OS: Any
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 !
Your email address:
Solve the problem:
43 - 25 = ?
Subscribe to this entry?

 [2018-08-13 13:16 UTC] tysonandre775 at hotmail dot com
The second argument (Tidy instance) is mandatory.

See - Because the same arginfo from the method is reused, the global function has incorrect reflection signatures.

For the global functions, PHP 7.1 and newer are affected was an earlier, incorrect attempt at fixing this, before noticing that I needed to stop reusing arginfo and that additional methods such as tidy_repair_string() also had incorrect signatures.


Test script:
var_export((new ReflectionFunction('tidy_getopt'))->getParameters());
// Same for tidy_get_root(), tidy_get_html(), tidy_get_head(), tidy_get_body(), tidy_repair_string(), and probably even more global functions

Expected result:
Expected: Both $option and $object should exist as required parameters on tidy_getopt.

The reflection signature of Tidy::getOpt(), etc. should not be changed by any bug fix.

Actual result:
Observed: Only one required parameter is rec

array (
  0 => 
     'name' => 'option',


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-14 13:48 UTC]
-Status: Open +Status: Verified
 [2020-04-16 10:39 UTC]
-Status: Verified +Status: Closed -Assigned To: +Assigned To: nikic
 [2020-04-16 10:39 UTC]
Fix in PHP 8 as part of stubs migration.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Oct 02 19:01:25 2023 UTC