{"id":3852,"date":"2022-08-20T20:04:05","date_gmt":"2022-08-20T14:34:05","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/"},"modified":"2022-08-20T20:04:05","modified_gmt":"2022-08-20T14:34:05","slug":"solved-php-parse-syntax-errors-and-how-to-solve-them","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/","title":{"rendered":"(Solved) PHP parse\/syntax errors; and how to solve them"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-18050072\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"18050072\" data-parentid=\"18050071\" data-score=\"314\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<h3>What are the syntax errors?<\/h3>\n<p>PHP belongs to the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/en.wikipedia.org\/wiki\/List_of_C-based_programming_languages\">C-style<\/a> and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/en.wikipedia.org\/wiki\/Imperative_programming\">imperative<\/a> programming languages. It has rigid grammar rules, which it cannot recover from when encountering misplaced symbols or identifiers. It can&#8217;t guess your coding intentions.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif\" alt=\"Function definition syntax abstract\"><\/p>\n<h3>Most important tips<\/h3>\n<p>There are a few basic precautions you can always take:<\/p>\n<ul>\n<li>\n<p>Use proper <strong>code indentation<\/strong>, or adopt any lofty coding style.<br \/>\nReadability prevents irregularities.<\/p>\n<\/li>\n<li>\n<p>Use an <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/en.wikipedia.org\/wiki\/List_of_PHP_editors\"><strong><em>IDE<\/em><\/strong> or editor for PHP<\/a> with <strong>syntax highlighting<\/strong>.<br \/>\nWhich also help with parentheses\/bracket balancing.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.png\" alt=\"Expected: semicolon\"><\/p>\n<\/li>\n<li>\n<p>Read <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.php.net\/langref\">the language reference<\/a> and examples in the manual.<br \/>\nTwice, to become somewhat proficient.<\/p>\n<\/li>\n<\/ul>\n<h3>How to interpret parser errors<\/h3>\n<p>A typical syntax error message reads:<\/p>\n<blockquote>\n<p>Parse error: syntax error, unexpected <strong>T_STRING<\/strong>, expecting <strong>&#8216;<code>;<\/code>&#8216;<\/strong> in <em>file.php<\/em> on <strong>line<\/strong> <em>217<\/em><\/p>\n<\/blockquote>\n<p>Which lists the <em>possible<\/em> location of a syntax mistake. See the mentioned <strong>file name<\/strong> and <strong>line number<\/strong>.<\/p>\n<p>A <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/php.net\/tokens\">moniker<\/a> such as <code>T_STRING<\/code> explains which symbol the parser\/tokenizer couldn&#8217;t process finally. This isn&#8217;t necessarily the cause of the syntax mistake, however.<\/p>\n<p>It&#8217;s important to look into <strong>previous code lines<\/strong> as well. Often syntax errors are just mishaps that happened earlier. The error line number is just where the parser conclusively gave up to process it all.<\/p>\n<h2>Solving syntax errors<\/h2>\n<p>There are many approaches to narrow down and fix syntax hiccups.<\/p>\n<ul>\n<li>\n<p>Open the mentioned source file. Look at the mentioned <strong>code line<\/strong>.<\/p>\n<ul>\n<li>\n<p>For runaway strings and misplaced operators, this is usually where you find the culprit.<\/p>\n<\/li>\n<li>\n<p>Read the line left to right and imagine what each symbol does.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>More regularly you need to look at <strong>preceding lines<\/strong> as well.<\/p>\n<ul>\n<li>\n<p>In particular, missing <code>;<\/code> semicolons are missing at the previous line ends\/statement. (At least from the stylistic viewpoint. )<\/p>\n<\/li>\n<li>\n<p>If <code>{<\/code> code blocks <code>}<\/code> are incorrectly closed or nested, you may need to investigate even further up the source code. Use proper <em>code indentation<\/em> to simplify that.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Look at the <strong>syntax colorization<\/strong>!<\/p>\n<ul>\n<li>\n<p>Strings and variables and constants should all have different colors.<\/p>\n<\/li>\n<li>\n<p>Operators <code>+-*\/.<\/code> should be tinted distinct as well. Else they might be in the wrong context.<\/p>\n<\/li>\n<li>\n<p>If you see string colorization extend too far or too short, then you have found an unescaped or missing closing <code>\"<\/code> or <code>'<\/code> string marker.<\/p>\n<\/li>\n<li>\n<p>Having two same-colored punctuation characters next to each other can also mean trouble. Usually, operators are lone if it&#8217;s not <code>++<\/code>, <code>--<\/code>, or parentheses following an operator. Two strings\/identifiers directly following each other are incorrect in most contexts.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Whitespace is your friend<\/strong>.<br \/>\n Follow <em>any<\/em> coding style.\n <\/p>\n<\/li>\n<li>\n<p>Break up long lines temporarily.<\/p>\n<ul>\n<li>\n<p>You can freely <strong>add newlines<\/strong> between operators or constants and strings. The parser will then concretize the line number for parsing errors. Instead of looking at the very lengthy code, you can isolate the missing or misplaced syntax symbol.<\/p>\n<\/li>\n<li>\n<p>Split up complex <code>if<\/code> statements into distinct or nested <code>if<\/code> conditions.<\/p>\n<\/li>\n<li>\n<p>Instead of lengthy math formulas or logic chains, use temporary variables to simplify the code. (More readable = fewer errors.)<\/p>\n<\/li>\n<li>\n<p>Add newlines between:<\/p>\n<ol>\n<li>The code you can easily identify as correct,<\/li>\n<li>The parts you&#8217;re unsure about,<\/li>\n<li>And the lines which the parser complains about. <\/li>\n<\/ol>\n<p>Partitioning up long code blocks <em>really<\/em> helps to locate the origin of syntax errors.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Comment out<\/strong> offending code.<\/p>\n<ul>\n<li>\n<p>If you can&#8217;t isolate the problem source, start to comment out (and thus temporarily remove) blocks of code.<\/p>\n<\/li>\n<li>\n<p>As soon as you got rid of the parsing error, you have found the problem source. Look more closely there.<\/p>\n<\/li>\n<li>\n<p>Sometimes you want to temporarily remove complete function\/method blocks. (In case of unmatched curly braces and wrongly indented code.)<\/p>\n<\/li>\n<li>\n<p>When you can&#8217;t resolve the syntax issue, try to <strong>rewrite<\/strong> the commented out sections <strong>from scratch<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>As a newcomer, avoid some of the confusing syntax constructs.<\/p>\n<ul>\n<li>\n<p>The ternary <code>? :<\/code> condition operator can compact code and is useful indeed. But it doesn&#8217;t aid readability in all cases. Prefer plain <code>if<\/code> statements while unversed.<\/p>\n<\/li>\n<li>\n<p>PHP&#8217;s alternative syntax (<code>if:<\/code>\/<code>elseif:<\/code>\/<code>endif;<\/code>) is common for templates, but arguably less easy to follow than normal <code>{<\/code> code <code>}<\/code> blocks.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>The most prevalent newcomer mistakes are:<\/p>\n<ul>\n<li>\n<p>Missing semicolons <code>;<\/code> for terminating statements\/lines.<\/p>\n<\/li>\n<li>\n<p>Mismatched string quotes for <code>\"<\/code> or <code>'<\/code> and unescaped quotes within.<\/p>\n<\/li>\n<li>\n<p>Forgotten operators, in particular for the string <code>.<\/code> concatenation.<\/p>\n<\/li>\n<li>\n<p>Unbalanced <code>(<\/code> parentheses <code>)<\/code>. Count them in the reported line. Are there an equal number of them?<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Don&#8217;t forget that solving one syntax problem can uncover the next.<\/p>\n<ul>\n<li>\n<p>If you make one issue go away, but other crops up in some code below, you&#8217;re mostly on the right path.<\/p>\n<\/li>\n<li>\n<p>If after editing a new syntax error crops up in the same line, then your attempted change was possibly a failure. (Not always though.)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Restore a backup of previously working code, if you can&#8217;t fix it.<\/p>\n<ul>\n<li>Adopt a source code versioning system. You can always view a <code>diff<\/code> of the broken and last working version. Which might be enlightening as to what the syntax problem is.<br \/>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Invisible stray Unicode characters<\/strong>: In some cases, you need to use a hexeditor or different editor\/viewer on your source. Some problems cannot be found just from looking at your code.<\/p>\n<ul>\n<li>\n<p>Try <code>grep --color -P -n \"\\[\\x80-\\xFF\\]\" file.php<\/code> as the first measure to find non-ASCII symbols.<\/p>\n<\/li>\n<li>\n<p>In particular BOMs, zero-width spaces, or non-breaking spaces, and smart quotes regularly can find their way into the source code.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Take care of which <strong>type of linebreaks<\/strong> are saved in files.<\/p>\n<ul>\n<li>\n<p>PHP just honors <kbd>\\n<\/kbd> newlines, not <kbd>\\r<\/kbd> carriage returns.<\/p>\n<\/li>\n<li>\n<p>Which is occasionally an issue for MacOS users (even on OS\u00a0 X for misconfigured editors).<\/p>\n<\/li>\n<li>\n<p>It often only surfaces as an issue when single-line <code>\/\/<\/code> or <code>#<\/code> comments are used. Multiline <code>\/*...*\/<\/code> comments do seldom disturb the parser when linebreaks get ignored.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>If your <strong>syntax error does not transmit over the web<\/strong>:<br \/>\n It happens that you have a syntax error on your machine. But posting the very same file online does not exhibit it anymore. Which can only mean one of two things:<\/p>\n<ul>\n<li>\n<p>You are looking at the wrong file!<\/p>\n<\/li>\n<li>\n<p>Or your code contained invisible stray Unicode (see above).<br \/>\nYou can easily find out: Just copy your code back from the web form into your text editor.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Check your <strong>PHP version<\/strong>. Not all syntax constructs are available on every server.<\/p>\n<ul>\n<li>\n<p><code>php -v<\/code> for the command line interpreter<\/p>\n<\/li>\n<li>\n<p><code>&lt;?php phpinfo();<\/code> for the one invoked through the webserver.<\/p>\n<\/li>\n<\/ul>\n<p> Those aren&#8217;t necessarily the same. In particular when working with frameworks, you will them to match up.<\/p>\n<\/li>\n<li>\n<p>Don&#8217;t use <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.php.net\/reserved.keywords\">PHP&#8217;s reserved keywords<\/a> as identifiers for functions\/methods, classes or constants.<\/p>\n<\/li>\n<li>\n<p>Trial-and-error is your last resort.<\/p>\n<\/li>\n<\/ul>\n<p>If all else fails, you can always <strong>google<\/strong> your error message. Syntax symbols aren&#8217;t as easy to search for (Stack Overflow itself is indexed by <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/symbolhound.com\/\">SymbolHound<\/a> though). Therefore it may take looking through a few more pages before you find something relevant.<\/p>\n<p>Further guides:<\/p>\n<ul>\n<li><em><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.onlamp.com\/pub\/a\/php\/2004\/08\/12\/debuggingphp.html\">PHP Debugging Basics<\/a><\/em> by David Sklar<\/li>\n<li><em><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/jason.pureconcepts.net\/2013\/05\/fixing-php-errors\/\">Fixing PHP Errors<\/a><\/em> by Jason McCreary<\/li>\n<li><em><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.phpreferencebook.com\/misc\/php-errors-common-mistakes\/\">PHP Errors \u2013 10 Common Mistakes<\/a><\/em> by Mario Lurig<\/li>\n<li><em><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/coursesweb.net\/php-mysql\/common-php-errors-solution_t\">Common PHP Errors and Solutions<\/a><\/em><\/li>\n<li><em><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/diythemes.com\/thesis\/troubleshoot-wordpress-website\/\">How to Troubleshoot and Fix your WordPress Website<\/a><\/em><\/li>\n<li><em><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/coding.smashingmagazine.com\/2011\/11\/30\/a-guide-to-php-error-messages-for-designers\/\">A Guide To PHP Error Messages For Designers<\/a><\/em> &#8211; Smashing Magazine<\/li>\n<\/ul>\n<h3>White screen of death<\/h3>\n<p>If your website is just blank, then typically a syntax error is the cause.<br \/>\nEnable their display with:<\/p>\n<ul>\n<li><code>error_reporting = E_ALL<\/code><\/li>\n<li><code>display_errors = 1<\/code><\/li>\n<\/ul>\n<p>In your <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.php.net\/manual\/en\/configuration.file.php\"><code>php.ini<\/code><\/a> generally, or via <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.php.net\/manual\/en\/configuration.changes.php\"><code>.htaccess<\/code><\/a> for mod_php,<br \/>\nor even <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/php.net\/manual\/en\/configuration.file.per-user.php\"><code>.user.ini<\/code><\/a> with FastCGI setups.<\/p>\n<p>Enabling it within the broken script is too late because PHP can&#8217;t even interpret\/run the first line. A quick workaround is crafting a wrapper script, say <code>test.php<\/code>:<\/p>\n<pre><code>&lt;?php\n   error_reporting(E_ALL);\n   ini_set(\"display_errors\", 1);\n   include(\".\/broken-script.php\");\n<\/code><\/pre>\n<p>Then invoke the failing code by accessing this wrapper script.<\/p>\n<p>It also helps to enable PHP&#8217;s <code>error_log<\/code> and look into your <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.cyberciti.biz\/faq\/apache-logs\/\">webserver&#8217;s <code>error.log<\/code><\/a> when a script crashes with HTTP 500 responses.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">2<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved PHP parse\/syntax errors; and how to solve them <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] What are the syntax errors? PHP belongs to the C-style and imperative programming languages. It has rigid grammar rules, which it cannot recover from when encountering misplaced symbols or identifiers. It can&#8217;t guess your coding intentions. Most important tips There are a few basic precautions you can always take: Use proper code indentation, or &#8230; <a title=\"(Solved) PHP parse\/syntax errors; and how to solve them\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\" aria-label=\"More on (Solved) PHP parse\/syntax errors; and how to solve them\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[381,380,339,382],"class_list":["post-3852","post","type-post","status-publish","format-standard","hentry","category-solved","tag-debugging","tag-parsing","tag-php","tag-syntax-error"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>(Solved) PHP parse\/syntax errors; and how to solve them - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"(Solved) PHP parse\/syntax errors; and how to solve them - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] What are the syntax errors? PHP belongs to the C-style and imperative programming languages. It has rigid grammar rules, which it cannot recover from when encountering misplaced symbols or identifiers. It can&#8217;t guess your coding intentions. Most important tips There are a few basic precautions you can always take: Use proper code indentation, or ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-20T14:34:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"(Solved) PHP parse\/syntax errors; and how to solve them\",\"datePublished\":\"2022-08-20T14:34:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\"},\"wordCount\":1249,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif\",\"keywords\":[\"debugging\",\"parsing\",\"php\",\"syntax-error\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\",\"name\":\"(Solved) PHP parse\/syntax errors; and how to solve them - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif\",\"datePublished\":\"2022-08-20T14:34:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"(Solved) PHP parse\/syntax errors; and how to solve them\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"(Solved) PHP parse\/syntax errors; and how to solve them - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/","og_locale":"en_US","og_type":"article","og_title":"(Solved) PHP parse\/syntax errors; and how to solve them - JassWeb","og_description":"[ad_1] What are the syntax errors? PHP belongs to the C-style and imperative programming languages. It has rigid grammar rules, which it cannot recover from when encountering misplaced symbols or identifiers. It can&#8217;t guess your coding intentions. Most important tips There are a few basic precautions you can always take: Use proper code indentation, or ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/","og_site_name":"JassWeb","article_published_time":"2022-08-20T14:34:05+00:00","og_image":[{"url":"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif","type":"","width":"","height":""}],"author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"(Solved) PHP parse\/syntax errors; and how to solve them","datePublished":"2022-08-20T14:34:05+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/"},"wordCount":1249,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"image":{"@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage"},"thumbnailUrl":"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif","keywords":["debugging","parsing","php","syntax-error"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/","url":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/","name":"(Solved) PHP parse\/syntax errors; and how to solve them - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage"},"image":{"@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage"},"thumbnailUrl":"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif","datePublished":"2022-08-20T14:34:05+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#primaryimage","url":"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/uploads\/2022\/08\/Solved-PHP-parsesyntax-errors-and-how-to-solve-them.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-php-parse-syntax-errors-and-how-to-solve-them\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"(Solved) PHP parse\/syntax errors; and how to solve them"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/3852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=3852"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/3852\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=3852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=3852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=3852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}