php - private class Error Undefined property -


Good morning everyone, I have one class, which enters the second category first.

The Private $ mine is close to the Segunata class, and returns the error undefined property: session: $ my line, if ($ this-> my )

I would be very grateful for help.

sample code,

  class session {public function run_session () {..run .. data :: runs ($ line); }} Class data {private $ my = "../../my/"; Public Function Run ($ line) {If ($ this-> My line) {.... Playing ...}}}    

You should use this way

  class data {personal $ my = "../../my/"; Public Function Run ($ line) {If ($ this-> My line) {// Here you are using $ $, then the function must call the class data object ... Play ... }}} Class session {public function run_session () {..run .. $ data = new data (); // To create the object of the class data, so that you run the function $ data-> Call ($ line) call; }}    

Comments