how to make object public to all function in a class?

Posted by thesocialhacker on Stack Overflow See other posts from Stack Overflow or by thesocialhacker
Published on 2011-01-12T16:50:51Z Indexed on 2011/01/12 16:54 UTC
Read the original article Hit count: 93

Filed under:
|

I've created a class that calls an object in the "__construct" how can i make this object available through out the class.

class SocialMedia { function __construct() { $object = "whatever"; } }

how can I access $object in the other funtions (which are static) from with in the class. I've tried to use "$this->object" but I get an error "$this when not in object context" when I try to call it from my other static functions.

© Stack Overflow or respective owner

Related posts about php

Related posts about class