Ticket #6056 (closed defect (bug): fixed)

Opened 10 months ago

Last modified 10 months ago

Fatal error: Only variables can be passed by reference in /wp-admin/includes/media.php on line 36

Reported by: DD32 Assigned to: anonymous
Priority: normal Milestone: 2.5
Component: General Version: 2.5
Severity: normal Keywords: has-patch
Cc:

Description

'Fatal error: Only variables can be passed by reference in ~/wordpress/wp-admin/includes/media.php on line 36'

Running on PHP 5.0.5

Attachments

6056.diff (0.6 kB) - added by DD32 on 03/01/08 09:45:25.
6056.2.diff (1.4 kB) - added by DD32 on 03/01/08 10:02:25.

Change History

03/01/08 09:45:25 changed by DD32

  • attachment 6056.diff added.

03/01/08 09:46:40 changed by DD32

Should mention this is while trying to load the add-media dialogues.

03/01/08 09:58:08 changed by DD32

hit another:

Fatal error: Only variables can be passed by reference in /wordpress/wp-admin/includes/media.php on line 244

updating patch.

03/01/08 10:02:25 changed by DD32

  • attachment 6056.2.diff added.

03/01/08 10:03:39 changed by DD32

suspect it'd also happen on line #635 as well (given the same function use)

03/01/08 15:16:07 changed by andy

Is that a bug in 5.0.5? Seemed like valid code. Good workaround!

03/01/08 20:41:19 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [7124]) Fix passed by reference errors. Props DD32. fixes #6056

03/01/08 23:17:18 changed by DD32

Must be a bug in 5.0.5.. That combination is mentioned on the php.net site.

I wish my host would upgrade to the more stable 5.2 :)

03/01/08 23:19:58 changed by DD32

Some info on it: http://the-stickman.com/web-development/php/php-505-fatal-error-only-variables-can-be-passed-by-reference/

For reference, This would be valid and would work (Because its saved to a variable first..)

$current = array_shift( $keys = array_keys($tabs) );

03/02/08 00:04:33 changed by darkdragon

That is fascinating. That code is basically:

$current = array_keys($tabs)[0];

It is too bad, but maybe more lobbying can be made to allow for the above code to function in PHP.