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: 737
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano (I) Frankfurt (D)
Contact:

error suppression on constants.php

Post by 3Di » Tue Mar 07, 2017 2:24 am

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?
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

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

Re: error suppression on constants.php

Post by pierredu » Tue Mar 07, 2017 1:54 pm

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


User avatar
david63
Registered User
Posts: 253
Joined: Mon Feb 07, 2005 7:23 am
Location: Lancashire, UK

Re: error suppression on constants.php

Post by david63 » Tue Mar 07, 2017 4:02 pm

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: 364
Joined: Fri Jul 08, 2011 9:43 pm

Re: error suppression on constants.php

Post by JoshyPHP » Tue Mar 07, 2017 4:31 pm


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

Re: error suppression on constants.php

Post by Phonefix » Fri Sep 29, 2017 12:22 pm

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