Error Unexpected T_public
Contents |
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
Syntax Error Unexpected 'public' (t_public) Laravel
about Stack Overflow the company Business Learn more about hiring developers or posting ads message: syntax error, unexpected 'public' (t_public) with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow
Parse Error Syntax Error Unexpected 'public' (t_public) In Wordpress
is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP Parse error: syntax error, unexpected T_PUBLIC [closed] up vote 9 down syntax error unexpected t_public codeigniter vote favorite 3 I am getting this error in this PHP code on line 3, what could be wrong? This code has been taken from php manual user notes by frank at interactinet dot com myMethod()) { // $val might be 1 instead of the expected 'test' } if( ($val = $this->myMethod()) [symfony\component\debug\exception\fatalerrorexception] syntax error, unexpected 'public' (t_public) ) { // now $val should be 'test' } // or to check for false if( !($val = $this->myMethod()) ) { // this will not run since $val = 'test' and equates to true } // this is an easy way to assign default value only if a value is not returned: if( !($val = $this->myOtherMethod()) ) { $val = 'default' } ?> php share|improve this question edited Jul 31 '15 at 20:22 ceejayoz 116k27177260 asked Nov 12 '12 at 9:43 Ashish Yadav 71115 closed as too localized by deceze, GBD, Anax, mario, ronalchn Nov 12 '12 at 10:03 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 1 Looks like this is supposed to be part of a class definition. This won't run as is. –deceze Nov 12 '12 at 9:44 in addition, the code is showcasing bad programming, something you s
PHP Forum View Course 487 points Submitted by Vu Nguyen Viet
Syntax Error Unexpected 'public' Laravel
about 3 years ago [solved]Parse error: syntax error, unexpected parse error syntax error unexpected 'public' (t_public) opencart T_PUBLIC on line 14 The code passed but it threw an error! need help
Syntax Error, Unexpected '?>', Expecting Function (t_function)
Parse error: syntax error, unexpected T_PUBLIC on line 14 here's my code
name = $name; } public function bark(){ return "Woof!"; } public function greet(){ return "Bow wow my name is ". $this->name . "bow wow!!"; https://www.codecademy.com/en/forum_questions/5224cc21548c359fa900352b } $dog1 = new Dog("Barker"); $dog2 = new Dog("Amigo"); echo $dog1->bark(); ?>
Thank you in advance UPDATE: Move methods into classname = $name; public function bark(){ return "Woof!"; } public function greet(){ return "Bow wow my name is ". $this->name . "bow wow!!"; } } $dog1 = new Dog("Barker"); $dog2 = new Dog("Amigo"); echo $dog1->bark(); ?>
1 vote permalink Hello, your methods aren't part of your class. 3108 points Submitted by boring12345 about 3 years ago 2 Comments Vu Nguyen Viet about 3 years ago Thank you how silly I am :) boring12345 about 3 years ago You are welcome! :-)Forum vBulletin 3.8 vBulletin 3.8 Support & Troubleshooting Join us on Facebook, Twitter and YouTube. Welcome to the vBulletin support http://www.vbulletin.com/forum/forum/vbulletin-3-8/vbulletin-3-8-questions-problems-and-troubleshooting/383788-parse-error-syntax-error-unexpected-t-public-expecting-] forums! In the forums you can receive professional support and assistance with any issues you might have with your vBulletin Products. If you are having problems posting in the relevant areas for your software, please see this topic. Announcement Collapse No announcement yet. Parse error: syntax error, unexpected T_PUBLIC, expecting ']' Collapse X Collapse Posts Latest Activity Search syntax error Page of 1 Filter Time All Time Today Last Week Last Month Show All Discussions only Photos only Videos only Links only Polls only Filtered by: Clear All new posts Previous Next Wolfegar Member Join Date: Nov 2005 Posts: 95 #1 Parse error: syntax error, unexpected T_PUBLIC, expecting ']' Tue 1st Mar '11, 10:04pm Lately, every time I try syntax error unexpected to edit a poll, I get this error. Parse error: syntax error, unexpected T_PUBLIC, expecting ']' in /home/******/public_html/forum/poll.php(495) : eval()'d code on line 97 How can I fix this? Tags: error, parse, syntax, t_public, unexpected Trevor Hannant vBulletin Support Join Date: Aug 2002 Posts: 22605 #2 Wed 2nd Mar '11, 4:33am eval()'d code errors normally come from issues with plugins. To troubleshoot this, first reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server. Also be sure to upload the admincp files to whichever directory you have set in your config.php file. Then run 'Suspect File Versions' in Diagnostics to make sure you have all the original files for your version and that none show 'File does not contain expected contents': Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions [Note: In some cases you may also need to remove any of the listed .xml files in the includes/xml directory.] Next, disable all plugins. Note: To temporarily disa