SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Whats wrong with this line?

    Hi guys I have

    function ExtractPhotos ($this->photo) {

    and it says 'Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ')' in /home/musiclis/public_html/spider.php on line 22'.

    Am I not suppose to put class variables in a function string?
    Have a good day.

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Not when defining the function. Then you should just use a regular variable, which is used internally by the function to obtain the value that you pass to it.

    Yours, Erik.
    ERIK RIKLUND :: Yes, I've been gone quite a while.

  3. #3
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, I fixed it instead I just did
    function ExtractPhotos () {
    because the class variable was already defined, I did not have to define it again.
    Have a good day.

  4. #4
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Aha, you were talking about a class method. I thought you were defining a regular function.

    Yours, Erik.
    ERIK RIKLUND :: Yes, I've been gone quite a while.


Bookmarks

Posting Permissions

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