Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#6185 closed enhancement (fixed)

Usage of var keyword generates an E_STRICT warning when using PHP 5 before version 5.1.3

Reported by: henrywright's profile henry.wright Owned by: djpaul's profile DJPaul
Milestone: 2.3 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch
Cc:

Description

Should declarations that use the var keyword be changed to public? I think they're treated as such.

An example can be seen in the BP_Activity_Activity class.

Attachments (1)

6185.diff (19.0 KB) - added by henry.wright 10 years ago.

Download all attachments as: .zip

Change History (10)

#1 @DJPaul
10 years ago

  • Component changed from API to Tools - Warnings/Notices
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from defect (bug) to enhancement
  • Version 2.2 deleted

Sure. As you probably know, var is left-over from PHP 4. I think PHP added the warning in 5.0-ish but then removed it in a 5.2-ish release, which is why we haven't seen this before.

We can fix these up because PHP4, but as WP requires PHP >= 5.2, you should upgrade to a modern version of PHP ;)

#2 @henry.wright
10 years ago

but as WP requires PHP >= 5.2, you should upgrade to a modern version of PHP ;)

Good advice :)

#3 @henry.wright
10 years ago

Just been through BP. These are the classes that are affected:

  • BP_XProfile_Component
  • BP_Activity_Activity
  • BP_XProfile_Data_Template
  • BP_Groups_Template
  • BP_Groups_Group_Members_Template
  • BP_Forums_Template_Forum
  • BP_Forums_Template_Topic
  • BP_Core_Members_Template
  • BP_Activity_Template

#4 @henry.wright
10 years ago

  • Keywords has-patch added

This is most probably a very low priority ticket, but, attached is 6185.diff which should eradicate the E_STRICT warning.

@henry.wright
10 years ago

#5 @DJPaul
10 years ago

  • Milestone changed from Future Release to 2.3

#6 @henry.wright
10 years ago

  • Summary changed from Usage of var keyword generates an E_STRICT warning when using PHP 5 before version 5.13 to Usage of var keyword generates an E_STRICT warning when using PHP 5 before version 5.1.3

#7 @DJPaul
10 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

#8 @djpaul
10 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 9515:

Replace use of PHP4-era var class properties keywords with public.

Also adds some phpDoc.

Fixes #6185, props henry.wright

#9 @DJPaul
8 years ago

  • Component changed from Tools - Warnings/Notices to Core
Note: See TracTickets for help on using tickets.