Oleg Posted April 16, 2007 Share Posted April 16, 2007 Hi all! I am trying to stitch to OOP and to php5. this is my code: <?php class MyClass { public $names = array("Oleg","Andrey","Tim","Shuks","John","Mark"); public static function MyName() { for($i = 0; $i <= 6; $i++) { print "My Public name is - $i <br />"; } } private function MyOtherNames() { for($i = 0; $i <= 6; $i ++) { print "My Private name is $i <br />"; } } public static function OtherNames() { MyClass::MyName(); print_r $this->names; } } MyClass::OtherNames(); ?> It gives me this error.. Why? Link to comment https://forums.phpfreaks.com/topic/47163-oop-error/ Share on other sites More sharing options...
HoTDaWg Posted April 16, 2007 Share Posted April 16, 2007 there are three mistakes with this post: 1. state WHAT error you are getting. 2. please use the [ code ] tags 3. there is a seperate forum for O.O.P keep this in mind. HoTDaWg Link to comment https://forums.phpfreaks.com/topic/47163-oop-error/#findComment-229992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.