php E_STRICT

Discussion forum for MOD Writers regarding MOD Development.
Locked
pixel001
Registered User
Posts: 100
Joined: Thu Aug 23, 2007 11:38 am

php E_STRICT

Post by pixel001 »

can i ask why phpbb still uses deprecated code like this, for example in acp_main.php

Code: Select all

var $u_action;


if you have error_reporting set to "E_ALL | E_STRICT" in php.ini then you'll get this in Apache logs :

"PHP Strict Standards: var: Deprecated. Please use the public/private/protected modifiers."

it is not good practice to declare global variables without saying what scope it is.

http://www.php.net/manual/en/language.o ... bility.php

is this done in order to stay compatible with php 4 ?
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26842
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: php E_STRICT

Post by Paul »

php4 doesnt support public/private/protected vars in classes. So you only can use var.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: php E_STRICT

Post by Erik Frèrejean »

Yes this is in place for php 4 as it don't understand public/etc.
You shouldn't set error reporting to strict when coding for phpBB3.0.x cause it will find a lot of this kind of problems.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
pixel001
Registered User
Posts: 100
Joined: Thu Aug 23, 2007 11:38 am

Re: php E_STRICT

Post by pixel001 »

well, i think phpbb.com should release a php5-only version and maybe continue with a "legacy version" to cater for the laggards.

PHP 4 was declared EOL in 2007, and php5 was out since 2004 now.

i think it's time to move on.
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: php E_STRICT

Post by Erik Frèrejean »

phpBB3.2.x will require php 5.2+, but dropping php 4 for the 3.0 branch just doesn't make sense cause development of that version started way before the EOL of php 4, and was even released before the EOL.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
Locked

Return to “[3.0.x] MOD Writers Discussion”