Bug Report #293

set_global(): take objects just like arrays

Added by fel64 - about 7 years ago. Updated about 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:2.1
Resolution:wontfix Points:


View_Core->set_global() takes variable_name - value pairs as well as associative arrays. I can't see a reason for it not to accept objects as well (and then just use the public member variables). It threw me when I was writing a bit of code and I'd like set_global() to just take my object without having to worry about casting it first.

Therefore: the world's shortest patch.

public function set_global( $name, $value = NULL )
        if ( !is_array( $name ) && !is_object( $name ) ) {
            // ...

acceptobjects.patch Magnifier (692 Bytes) fel64 -, 12/29/2007 05:50 AM


#1 Updated by Woody Gilk about 7 years ago

  • Status changed from New to Closed
  • Resolution set to wontfix

Casting is the correct way to solve this. If we start accepting objects for arrays, then it needs to be reflected across the entire framework. There is no reason to do that, at this time.

Also available in: Atom PDF