|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27570 Tidy throw
Submitted: 2004-03-11 11:24 UTC Modified: 2004-04-19 17:19 UTC
From: Assigned: john (profile)
Status: Closed Package: Tidy (PECL)
PHP Version: 5CVS-2004-03-11 (dev) OS: *
Private report: No CVE-ID: None
 [2004-03-11 11:24 UTC]
Using the given example, PHP exits.

I think the problem is in TIDY_THROW.

Reproduce code:
$tidy = tidy_parse_file('bogus.htm');

echo 'ok';

Expected result:

Actual result:
(gdb) run bug.php
Starting program: /home/Nuno/php5/sapi/cli/php.exe bug.php

Warning: tidy_parse_file(bogus.htm): failed to open stream: No such file or dire
ctory in /home/Nuno/php5/sapi/cli/bug.php on line 2

Fatal error: Uncaught exception 'tidy_exception' with message 'Cannot Load 'bogu
s.htm' into memory ' in /home/Nuno/php5/sapi/cli/bug.php:2
Stack trace:
#0 {main}
  thrown in /home/Nuno/php5/sapi/cli/bug.php on line 2

Program exited with code 0377.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-13 04:55 UTC]
And the problem is what? (AFAIK, this is the expected behaviour..)

 [2004-03-13 16:50 UTC]
All functions that use TIDY_THROW exit PHP when an error is produced.
Closing PHP just because the file was not found isn't a really good behaviour :)
 [2004-03-13 20:44 UTC]
This isn't really a bug per-se. Tidy is throwing an exception because it couldn't find the file, if you want to continue operation then you have to use a try / catch block. The only "bug" here is that when called from a procedural context tidy should be generating E_WARNINGs instead of throwing exceptions. 
 [2004-04-19 17:19 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Sep 25 08:05:54 2022 UTC