{"id":175,"date":"2025-12-16T06:21:00","date_gmt":"2025-12-16T11:21:00","guid":{"rendered":"https:\/\/kimsal.com\/blog\/?p=175"},"modified":"2025-12-15T18:25:18","modified_gmt":"2025-12-15T23:25:18","slug":"php-quality-tools-magic-number-detector","status":"publish","type":"post","link":"https:\/\/kimsal.com\/blog\/2025\/12\/16\/php-quality-tools-magic-number-detector\/","title":{"rendered":"PHP Quality Tools &#8211; magic number detector"},"content":{"rendered":"\n<p>Got magic numbers in your PHP? Find &#8217;em fast with <a href=\"https:\/\/github.com\/povils\/phpmnd\">PHP Magic Number Detector<\/a> tool.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if ($locationId === 8) {\n  \/\/ do something awesome\n}<\/code><\/pre>\n\n\n\n<p>probably seems OK to start with, but the next person (including yourself!) coming at this later will wonder what the heck &#8216;8&#8217; is. And&#8230; if you want to search for any other reference to this &#8216;magic&#8217; location ID&#8230; good luck searching your code for the number 8&#8230;<\/p>\n\n\n\n<p>Collapsed output in the image below, just to fit it in the picture.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"985\" height=\"1024\" src=\"https:\/\/kimsal.com\/blog\/wp-content\/uploads\/2025\/12\/php-magic-number-detector-985x1024.png\" alt=\"\" class=\"wp-image-176\" srcset=\"https:\/\/kimsal.com\/blog\/wp-content\/uploads\/2025\/12\/php-magic-number-detector-985x1024.png 985w, https:\/\/kimsal.com\/blog\/wp-content\/uploads\/2025\/12\/php-magic-number-detector-288x300.png 288w, https:\/\/kimsal.com\/blog\/wp-content\/uploads\/2025\/12\/php-magic-number-detector-768x799.png 768w, https:\/\/kimsal.com\/blog\/wp-content\/uploads\/2025\/12\/php-magic-number-detector-1477x1536.png 1477w, https:\/\/kimsal.com\/blog\/wp-content\/uploads\/2025\/12\/php-magic-number-detector.png 1956w\" sizes=\"auto, (max-width: 985px) 100vw, 985px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Got magic numbers in your PHP? Find &#8217;em fast with PHP Magic Number Detector tool. probably seems OK to start with, but the next person (including yourself!) coming at this later will wonder what the heck &#8216;8&#8217; is. And&#8230; if you want to search for any other reference to this &#8216;magic&#8217; location ID&#8230; good luck&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-175","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/posts\/175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/comments?post=175"}],"version-history":[{"count":1,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/posts\/175\/revisions"}],"predecessor-version":[{"id":177,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/posts\/175\/revisions\/177"}],"wp:attachment":[{"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/media?parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/categories?post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kimsal.com\/blog\/wp-json\/wp\/v2\/tags?post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}