Skip to:
Content

Opened 5 years ago

Closed 4 years ago

#1187 closed defect (fixed)

Return by reference is deprecated in PHP 5.3

Reported by: nightgunner5 Owned by:
Milestone: 1.0.3 Priority: high
Severity: major Version: 1.0.1
Component: Back-end Keywords:
Cc:

Description

I just upgraded PHP to 5.3 and was greeted by error messages.

Deprecated: Assigning the return value of new by reference is deprecated in J:\www\htdocs\public_html\forums\bb-settings.php on line 186

Deprecated: Assigning the return value of new by reference is deprecated in J:\www\htdocs\public_html\forums\bb-includes\backpress\functions.wp-object-cache.php on line 108

Deprecated: Assigning the return value of new by reference is deprecated in J:\www\htdocs\public_html\forums\bb-includes\backpress\pomo\mo.php on line 169

Deprecated: Assigning the return value of new by reference is deprecated in J:\www\htdocs\public_html\forums\bb-includes\functions.bb-l10n.php on line 484

Deprecated: Assigning the return value of new by reference is deprecated in J:\www\htdocs\public_html\forums\bb-includes\backpress\class.wp-taxonomy.php on line 581

Now here's a problem: Do we support PHP4 or PHP5.3+? PHP4 requires the reference, but PHP5+ doesn't, and sets it as a reference by default.

Change History (8)

comment:1 _ck_5 years ago

That's an easy answer.
You support PHP 4 and hide the deprecated warnings in 5.3

Set the error reporting level to E_ALL E_STRICT

(E_STRICT is new for PHP 5.3)

comment:2 _ck_5 years ago

ugh, sorry, stupid trac formatting

`E_ALL ^ E_STRICT`

comment:3 ramoonus5 years ago

  • Milestone changed from 1.1 to 1.0.3

even better;
E_ALL & ~E_DEPRECATED

comment:4 _ck_5 years ago

Which one works in reality? Can anyone test?

E_STRICT is actually PHP 5.x but E_DEPRECATED is new for 5.3 specifically.

I would think DEPRECATED is a subset of STRICT and not visa versa.

comment:5 ramoonus5 years ago

i might be able to test it tomorrow, my provider runs 5.3.0 but in CGI mode
i`ll force it throught a php_value in a .htaccess

comment:6 ramoonus5 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Added to bb-config.php
[code]error_reporting(E_ALL & ~E_DEPRECATED);
ini_set("display_errors","On"); code

no errors i see

comment:7 Nightgunner55 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

The problem is that the general population isn't as tech savvy as us, and will probably think that there's some huge error, not to mention the infamous "headers already sent" error.

Something could be added to bb-settings.php, like:

if ( !defined( 'BB_ERROR_REPORTING' ) ) {
    define( 'BB_ERROR_REPORTING', E_ALL & ~E_DEPRECATED );
}
error_reporting( BB_ERROR_REPORTING );

comment:8 Nightgunner54 years ago

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

Fixed in [2383]

Note: See TracTickets for help on using tickets.