{"id":14653,"date":"2020-06-10T13:59:41","date_gmt":"2020-06-10T13:59:41","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=14653"},"modified":"2022-04-13T15:58:39","modified_gmt":"2022-04-13T15:58:39","slug":"how-many-types-of-error-in-php","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-many-types-of-error-in-php\/","title":{"rendered":"How Many Types of Error in PHP?"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">PHP has four types of error which are defined as below with definitions:-<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Notice:-<\/h4>\n\n\n\n<p><strong>Notice<\/strong> <strong>error<\/strong> means when a variable that not yet been defined then shows <strong>Notice error<\/strong> in <strong>PHP<\/strong>. These are non-critical errors,  that <strong>PHP<\/strong> encounters while executing a script, for example, accessing. It is similar to a <strong>warning error<\/strong>. It means that the program has something wrong but it allows the execution of the script.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ajcotocus\/01154e8a9914c09a0d3b0fcee105fb53.js\"><\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"102\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/notices-error-1.png\" alt=\"\" class=\"wp-image-14672\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/notices-error-1.png 649w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/notices-error-1-300x47.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Warnings:-<\/h4>\n\n\n\n<p>The main reason of <strong>warning errors<\/strong> are including a missing file. This means that the <strong>PHP<\/strong> function calls the missing file. These are more serious errors &#8211; for example, attempting to include() a file that does not exist. By default, these errors are displayed to the users, but they do not result in script termination.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/ajcotocus\/df7984788a5b2399bec7b32143ef9864.js\"><\/script><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"156\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/warning-error-1.png\" alt=\"\" class=\"wp-image-14683\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/warning-error-1.png 1020w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/warning-error-1-300x46.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/warning-error-1-768x117.png 768w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Fatal errors:-<\/h4>\n\n\n\n<p><strong>Fatal errors<\/strong> are caused when <strong>PHP<\/strong> understands what you\u2019ve written, however, what you\u2019re asking it to do can\u2019t be done. <strong>Fatal errors<\/strong> stop the execution of the script. These are critical errors- for example, an object of a non-existent class, or calling a non-existent function. <\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ajcotocus\/61018e8d16e0f1cd00d9837ede42ee81.js\"><\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"143\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/fatal-error-1-1024x143.png\" alt=\"\" class=\"wp-image-14686\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/fatal-error-1-1024x143.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/fatal-error-1-300x42.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/fatal-error-1-768x107.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/fatal-error-1.png 1049w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Parse error or Syntax Error:-<\/h4>\n\n\n\n<p>If there are syntax errors in <strong>PHP<\/strong> means <strong>Parse Error<\/strong>. It is the type of <strong>error<\/strong> done by the programmer in the source code of the program. The syntax error is caught by the compiler. After fixing the syntax error the compiler compiles the code and executes it. Parse errors can be caused dues to enclosed quotes, missing or Extra parentheses, Enclosed braces, Missing semicolon, etc.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ajcotocus\/50b3163f890f476eb460418e13553be1.js\"><\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"88\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/parse-error-1.png\" alt=\"\" class=\"wp-image-14691\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/parse-error-1.png 751w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/parse-error-1-300x35.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/parse-error-1-740x88.png 740w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/figure>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_97506\"><iframe loading=\"lazy\"  id=\"_ytid_36473\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_97506\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>PHP has four types of error which are defined as below with definitions:- Notice:- Notice error means when a variable that not yet been defined then shows Notice error in&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5150],"tags":[258,177,6228,5427],"class_list":["post-14653","post","type-post","status-publish","format-standard","hentry","category-php","tag-error","tag-php","tag-php7","tag-types"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=14653"}],"version-history":[{"count":8,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14653\/revisions"}],"predecessor-version":[{"id":24774,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14653\/revisions\/24774"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=14653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=14653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=14653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}