[5.x]: strict_variables #14955
-
What happened?DescriptionWhy is strict_variables set in dev mode? Steps to reproduce
Expected behaviorThe include should not generate an error. Because dev mode is stricter than production code. It should be the other way around. Actual behaviorthe a variable generates an error. Craft CMS versionall PHP versionNo response Operating system and versionNo response Database type and versionNo response Image driver and versionNo response Installed plugins and versions |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Because referencing nonexistent variables is generally considered a bad practice, and most likely a bug. So
Disagree. Generally the live site should be more resilient so bugs don’t impact front-end traffic. |
Beta Was this translation helpful? Give feedback.
Because referencing nonexistent variables is generally considered a bad practice, and most likely a bug. So
strict_variables
being enabled helps identify probable bugs, in dev environments where the error report won’t take your site down.Disagree. Generally the live site should be more resilient so bugs don’t impact front-end traffic.