PHP OOP variable scope problem
|
12-29-2010, 12:59 AM,
|
|||
|
|||
RE: PHP OOP variable scope problem
Thanks Richard! You're a hero! I give you +1 Positive for that one :)
This was what I was looking for: PHP Code: function Activate($Arg, $obj) { PHP Code: $this->One->Activate("the Oven", $this); I don't know why I forgot that you could pass on an instance as an argument, as I used to do it in AS 3 all the time. Regarding the static thing, I don't know why PHP doesn't print error messages. I've set php to display all errors in the .ini file. It's probably a windows fault. Anyway, I was just wondering. If I had a lot of properties/vars, would it be feasible to load them onto an array, and then pass the array as an argument (To Activate())? Would that be a valid way to do such without generating errors? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
PHP OOP variable scope problem - by Vanilla - 12-28-2010, 08:10 AM
RE: PHP OOP variable scope problem - by RichardGv - 12-28-2010, 04:12 PM
RE: PHP OOP variable scope problem - by Vanilla - 12-29-2010, 12:59 AM
RE: PHP OOP variable scope problem - by RichardGv - 12-29-2010, 11:26 AM
RE: PHP OOP variable scope problem - by Vanilla - 12-30-2010, 02:20 AM
RE: PHP OOP variable scope problem - by Vanilla - 01-03-2011, 09:09 AM
|