|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-11-11 17:35 UTC] 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;
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 31 23:00:01 2025 UTC |
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