|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75947 Tidy creates an undocumented property Tidy->value
Submitted: 2018-02-10 20:02 UTC Modified: 2018-02-28 23:15 UTC
From: tandre at themeetgroup dot com Assigned:
Status: Verified Package: Tidy (PECL)
PHP Version: Irrelevant OS:
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:
Solve the problem:
6 + 35 = ?
Subscribe to this entry?

 [2018-02-10 20:02 UTC] tandre at themeetgroup dot com
The test script shows that $x->value is indeed being created after calling parseString.

This property seems like it is created in all versions from PHP 5.0 to 7.2 (haven't checked earlier versions)

However, Tidy->value is not mentioned in any of the following places:

- does not mention that $tidy->value would be created.

Also, I'm wondering it it would make sense to deprecate attempts to access Tidy->value in PHP 7.3:

- It's undocumented, so not many applications would use it (hopefully)
- It's inefficient to generate HTML/XML strings which which won't be used
- Not sure if generating the string affects Tidy->errorBuffer.

I discovered this when investigating a bug in php's use of tidy-html5 5.6.0 (worked in 5.4.0): 

- Feel free to file a new issue for that if it makes sense to? I wasn't sure.

Test script:
$x = new Tidy();
$x->parseString('<p>example</p>', ['show-body-only'=>true]);
printf("Value property:   %s\n", $x->value);  // $x->value exists after calling parseString/parseFile, but 
printf("cast to (string): %s\n", (string)$x);

Expected result:
I expect the existence of the property Tidy->value to be documented on (Or to be deprecated in php 7.3 and removed in 8.0)

Actual result:
Tidy->value is not documented, but exists.
The above test script outputs the following:

Value property:   <p>example</p>

cast to (string): <p>example</p>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-28 23:15 UTC]
-Summary: Tidy creates an undocumented property Tidy->value after calling parseString() +Summary: Tidy creates an undocumented property Tidy->value -Status: Open +Status: Verified
 [2018-02-28 23:15 UTC]
> The test script shows that $x->value is indeed being created
> after calling parseString.

Actually, the `value` property is already created when the tidy
object is instantiated.  POC:

  $x = new tidy;
      property_exists('tidy', 'value'),
      property_exists($x, 'value)


PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Jun 07 09:01:23 2020 UTC