Php Error Unexpected Private
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up syntax error, unexpected T_PRIVATE - Magento up vote 0 down vote favorite My problem is with two functions : setEntityTypeFilter('4') ->addSetInfo() ->getData(); $attr = array(); $currStoreViewId = Mage::app()->getStore()->getId(); foreach($attributesInfo as $attribute): $attribute = Mage::getModel('eav/entity_attribute')->load($attribute['attribute_id']); if (!$attribute->getIsVisibleOnFront()) continue; $labels = $attribute->getStoreLabels(); if (isset($labels[$currStoreViewId])) $label = $labels[$currStoreViewId]; else $label = $attribute->getFrontendLabel(); $attr[ $attribute->getAttributeCode() ] = $label; endforeach; return $attr; } public function getProductAttributList($_product) { $pid = $_product->getId(); if (empty($pid)) return false; $attributes = $this->getAttributes(); if (count($attributes)>0) $html = '
'.$attrlabel.' | '.$value.' | '; } return $html.'
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Include, getting “PHP Parse error: syntax error, unexpected 'private' (T_PRIVATE)” up http://stackoverflow.com/questions/27378803/syntax-error-unexpected-t-private-magento vote 1 down vote favorite Hi guys haven done stuff on PHP for quite a while, but I was trying to get an coreDB.php file to have DB information and to be open and close from this file. Everything is working, but when I try to include this on another file, I allways get the error that I put on the title. coreDB file: http://stackoverflow.com/questions/35778208/include-getting-php-parse-error-syntax-error-unexpected-private-t-private { private $dbhost = "localhost"; private $dbuser = "user"; private $dbpass = "password"; private $dbname = "dbname"; public $conn; public function openDbConnection() { try { $this->conn = new PDO("mysql:host=$this->dbhost;dbname=$this->dbname", $this->dbuser, $this->dbpass); echo "Connection Done
"; } catch(PDOException $e) { //var_dump($this->conn); //echo $e->getMessage(); } } public function closeDbConnection() { try { $this->conn = NULL; echo "Connection Over"; } catch(PDOException $e) { //var_dump($this->conn); //echo $e->getMessage(); } } }?> The other file, clientNewRecord.php, where the previous is include: dbConnect->openDbConnection(); $this->dbConnect->closeDbConnection();?> I allways get this error: PHP Parse error: syntax error, unexpected 'private' when trying to open the clientNewRecord.php Isn't when I try to run the $this->dbConnect->openDbConnection(), to go into that file and run from that file? php private share|improve this question asked Mar 3 at 16:53 Camadas 449 2 private is only valid within a class/trait. –apokryfos Mar 3 at 16:56 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted change private $dbConnect = new ConnectionDB(); to $dbConnect = new ConnectionDB();. Access Specifiers are allowed only within the class. share|improve this answer answered Mar 3 at 16:57 ameenulla0007 2,5161612 Thanks :D it works now ... thi
New? Today's Posts FAQ Rules Guidelines Search Advanced Search Forum :: Server side development PHP Parse error: syntax error, unexpected T_PRIVATE in http://www.codingforums.com/php/185163-parse-error-syntax-error-unexpected-t_private.html If this is your first visit, be sure to check out the https://www.prestashop.com/forums/topic/207106-parse-error-syntax-error-unexpected-t-private-overrideclassestools/ FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Enjoy an ad free experience by logging in. Not php error a member yet? Register. Results 1 to 3 of 3 Thread: Parse error: syntax error, unexpected T_PRIVATE in Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible 12-23-2009,11:46 AM #1 Cacus View Profile View Forum Posts New Coder Join Date Jul 2006 Posts 96 Thanks 3 php error unexpected Thanked 0 Times in 0 Posts Parse error: syntax error, unexpected T_PRIVATE in Hi All I get the following error : Parse error: syntax error, unexpected T_PRIVATE in The line number indicates the following line : private function blankout($string) { I am calling the private function from within a public function. I initially tried calling it like so: PHP Code: $this->replacestring=$this->blankout($this->insert);
But then notice on some sites functions called as follows: PHP Code:
$this->blankout($this->insert);
Can anyone tell me were I've gone wrong. Cheers Full class code (though note class not finished!) PHP Code:
classbadwordsfilter{
private$addwords;
pri
Community Blog Create your store Français Español Deutsch Italiano Portuguese Polish Dutch English Features Templates Store Builder Shopping Cart Mobile eMarketing International Integrations Learn Getting Started Themes Modules Showcase Documentation Training Support FAQ Community Blog Download Modules Themes Forum English Français Español Deutsch Italiano Portuguese Polish Dutch Sign in Jump to content Forum → Community Help and Support → PrestaShop Download → Configuring and using PrestaShop Search Search section: This topic Forums Members Help Javascript Disabled Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. Parse error: syntax error, unexpected T_PRIVATE ..override/classes/Tools Started by m3isd, Nov 27 2012 06:48 PM, 1 reply to this topic Please log in to reply #1 m3isd Posted 27 November 2012 - 06:48 PM m3isd PrestaShop Newbie Members 14 Active Posts Hi - anyone for urgent help please> -I set "diplay errors" to "on" after 500 crash in the config.php - error message displayed hereafter:Parse error: syntax error, unexpected T_PRIVATE in /home/learning/public_html/override/classes/Tools.php on line 25Any help on this please guys - cannot access my site front and back - and error logs does not reveal much?Thanks for you time in advance.Pierre Back to top #2 m3isd Posted 27 November 2012 - 07:00 PM m3isd PrestaShop Newbie Members 14 Active Posts Hi Guys, Short terms fix replace the tools.php file with origonal source file and site up again - looks like and add-on that caused the problem or a wrong configuration applied to the add-on still looking for the real-issue will keep you posted. Thanks Pierre Back to top Back to Configuring and using PrestaShop 0 user(s) are reading this topic 0 members, 0 guests, 0 anonymous users Reply to quoted postsClear Get to know us English Français Español Deutsch Italiano Portuguese Polish Dutch Most Visited Live Demo Online Store Builder Shopping Cart Ecommerce Software Accept Payments Online Mobile Commerce Templates SEO Features Resources Trainings Modules Themes Getting Started Switch to PrestaShop Newsletter Documentation Status Partners Become a Partner Industry Partners Hosting