Question about OOP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Question about OOP

    Why do i get an unexpected function error in this code?
    PHP Code:
    <?php
    class function {
    function 
    test() {  $var "test";  echo $var;  }
    }
    $test = new function();
    echo 
    $test->test(); ?>
    Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

    #2
    PHP Code:
    <?php

    class myclass {
    function 
    test() {  $var "test";  echo $var;  }
    }
    $test = new myclass;
    echo 
    $test->test();

    ?>
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      dz myt be useful PHP: Classes and Objects - Manual

      Comment


        #4
        thanks dude, i feel stupid =/ lol
        @gum
        Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

        Comment

        Working...
        X