ID: 20373 Comment by: h4lfl1ng at inbox dot com Reported By: rkb at femkant dot dk Status: No Feedback Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4CVS-2002-11-11 New Comment:
PHP Version 4.4.2 <?php mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); $doc = new DOMDocument(); @$doc->loadHTML(file_get_contents('filewithlinks.html')); $links = $doc->getElementsByTagName('a'); for ($i = 0; $i < $links->length; $i++) { $value = addslashes($links->item($i)->nodeValue); $href = addslashes($links->item($i)->getAttribute('href')); mysql_query("INSERT INTO bookmarks(url, title) VALUES('$href', '$value' ) ") or die(mysql_error()); } echo $i . " Bookmarks Imported"; ?> I get the same error. On line 11 & 12 where $value & $href exist. Parse error: syntax error, unexpected T_OBJECT_OPERATOR in ... It works in PHP5, but not in php4.4.2 Previous Comments: ------------------------------------------------------------------------ [2003-11-20 02:14:44] jonny at sanriowasteland dot net I tested the code givin with PHP5 beta 2, and everything works as expected. ------------------------------------------------------------------------ [2003-01-02 18:38:58] [EMAIL PROTECTED] No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2002-12-08 16:28:29] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [2002-11-11 17:35:47] rkb at femkant dot dk The following script produces a "Parse error, unexpected T_OBJECT_OPERATOR in ..." message: class A {} class B { var $name = "A"; function test() { new $this->name; } } The following change will succeed: - new $this->name; + $tmp = $this->name; + new $tmp; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20373&edit=1