Edit report at http://bugs.php.net/bug.php?id=53163&edit=1

 ID:                 53163
 Updated by:         ras...@php.net
 Reported by:        borovoy dot anton at gmail dot com
 Summary:            trim() don't say about warning with
                     tidy_parse_string
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Gentoo
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

You have your memory limit set really low and you are looping infinitely
over a 

tidy_parse_string call against a 50k blob of html.

This has nothing to do with trim.  You are running out of memory doing
all the 

tidy stuff long before trim() is even called.


Previous Comments:
------------------------------------------------------------------------
[2010-10-26 10:35:29] borovoy dot anton at gmail dot com

Description:
------------
<?php

class test { public $value = 'Hi'; }                                    
                                                     

$obj = new test();                                                      
                                                     

trim($obj);

?>

result: Warning: trim() expects parameter 1 to be string, object given



<?php

$content = file_get_contents('http://php.net');                         
                                                     

while ($i = 1) { trim(tidy_parse_string($content, $tidy_config,
'utf8')); }

?>

result: Fatal error: Allowed memory size of 1048576 bytes exhausted
(tried to 

allocate 104 bytes)

php: tidylib.c:168: tidyDocRelease: Assertion `doc->docIn == ((void
*)0)' 

failed.



I think need warning and not eat all memory

thx



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53163&edit=1

Reply via email to