Issue Details (XML | Word | Printable)

Key: MDL-19698
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Petr Skoda
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-19415

deprecated new instance assignment

Created: 02/Jul/09 10:58 PM   Updated: 14/Oct/09 12:48 PM
Component/s: Forms Library
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Eric Bollens, Martin Dougiamas and Petr Skoda
Security Level: None
Resolved date: 03/Jul/09
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
$x = & new something(); is now deprecated and throws warnings

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 03/Jul/09 05:54 AM
done

Eric Bollens added a comment - 06/Oct/09 01:55 AM
Petr, which commits should fix these bad assignments? Checked CVS and it looks like there are definitely some illegal assignments still in the trunk. As far as I can tell, there are ~100 places in Moodle that make illegal old-style assignments.

Are these going to be patched based on changing syntax or using the PHP4/5 dual-compatibility workaround?

The former:

$obj =& new Class($attrs);
$obj = new Class($attrs);

The latter:

function & build(&$new){ return $new; }
$obj =& build(new Class($attrs));

This is an interesting issue that plagues Moodle heavily.


Martin Dougiamas added a comment - 14/Oct/09 12:42 PM
We don't support PHP 4 in Moodle 2, so we just need to change the syntax. Eric, could you post your list of places and perhaps even a patch?

Martin Dougiamas added a comment - 14/Oct/09 12:48 PM
Added Eric as a watcher