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: 694
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?
Want to compensate me for my interest? Don't ask me, just do it
I'm available for custom phpBB jobs, you can PM me the details.
New: my Live Board, Extensions and Tools for phpBB - Men at works.

User avatar
pierredu
Registered User
Posts: 33
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 Online
Registered User
Posts: 215
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: 348
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