operator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vexhawk
    New Member
    • Aug 2006
    • 1

    #1

    operator

    i'm kind of new to php, what does the operator -> mean, for example:

    function Session(){
    $this->time = time();
    $this->startSession() ;
    }


    Thanks for the help.
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    In short "$this->xyz" is is a reference to a calling object in Object Oriented Programming (OOP).

    But you'd better look and learn by reading the documentaiton about OOP. There are a zillion tutorials on OOP, but a good start is the PHP documentation itself.

    See link http://nl3.php.net/manual/en/language.oop5.basic.php

    Ronald :cool:

    Comment

    • vssp
      Contributor
      • Jul 2006
      • 268

      #3
      here is the example fror object initilization

      Object Initialization
      To initialize an object, you use the new statement to instantiate the object to a variable.


      <?php
      class foo
      {
      function do_foo()
      {
      echo "Doing foo.";
      }
      }

      $bar = new foo;
      $bar->do_foo();
      ?>

      Comment

      Working...