Results 1 to 4 of 4

Thread: PHP4: Constant inside a class

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Resolved PHP4: Constant inside a class

    This gives me PHP Parse error: syntax error, unexpected ';', expecting '(' in C:\Program Files\Apache Group\Apache2\htdocs\toolmon\_debug_tmp.php on line 15 having a code
    Code:
    class test {
      var $SOME_CONST = 10;
    }
    
    echo test::$SOME_CONST;
    Can't I create a constant variable inside a class?

    Thanks.
    Last edited by nebulom; May 24th, 2007 at 05:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width