error suppression on constants.php

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Post Reply
User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

error suppression on constants.php

Post by 3Di »

Line 254 of ./includes/constants.php (phpBB 3.2.x)

Code: Select all

@define('CONFIG_TABLE',				$table_prefix . 'config');
Notice the prepended "@", Is there any particular reason?
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

User avatar
pierredu
Registered User
Posts: 44
Joined: Sat Dec 05, 2015 7:21 am

Re: error suppression on constants.php

Post by pierredu »

There are 6 lines with '@'.
It must be a new syntax.

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: error suppression on constants.php

Post by hanakin »

Donations welcome via Paypal Image

User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: error suppression on constants.php

Post by david63 »

pierredu wrote: Tue Mar 07, 2017 1:54 pm It must be a new syntax.
No it has been around for years (since the start of PHP??)
But that does not answer the question as to why it is used in that instance - what possible error could be generated from that define statement?
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: error suppression on constants.php

Post by JoshyPHP »


Phonefix
Registered User
Posts: 1
Joined: Fri Sep 29, 2017 12:17 pm

Re: error suppression on constants.php

Post by Phonefix »

You can suppress the fatal error calls by putting an ampersand in front of the function ... If, however, it isn't a constant, PHP assumes it to be a string for the array.

Post Reply