File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,12 @@ define("__FOO__", "something");
100100 <simpara >
101101 If you use an undefined constant, PHP assumes that you mean
102102 the name of the constant itself, just as if you called it as
103- a <type >string</type > (CONSTANT vs "CONSTANT"). An error of level
104- <link linkend =" ref.errorfunc" >E_NOTICE</link > will be issued
105- when this happens. See also the manual entry on why
103+ a <type >string</type > (CONSTANT vs "CONSTANT").
104+ This fallback is deprecated as of PHP 7.2.0, and an error of level
105+ <constant >E_WARNING</constant > is issued when it happens
106+ (previously, an error of level
107+ <link linkend =" ref.errorfunc" >E_NOTICE</link > has been issued instead.)
108+ See also the manual entry on why
106109 <link linkend =" language.types.array.foo-bar" >$foo[bar]</link > is
107110 wrong (unless you first <function >define</function >
108111 <literal >bar</literal > as a constant). This does not apply to <link
Original file line number Diff line number Diff line change @@ -574,6 +574,13 @@ echo $foo[bar];
574574 constant named <constant >bar</constant >, then PHP will substitute in the
575575 <type >string</type > <literal >'bar'</literal > and use that.
576576 </para >
577+ <warning >
578+ <simpara >
579+ The fallback to treat an undefined constant as bare string is deprecated as
580+ of PHP 7.2.0, and issues an error of level <constant >E_WARNING</constant >.
581+ Formerly, an error of level <constant >E_NOTICE</constant > has been issued.
582+ </simpara >
583+ </warning >
577584
578585 <note >
579586 <simpara >
You can’t perform that action at this time.
0 commit comments