views:

744

answers:

3

I've created the a class and tested, and getting the error

Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /usr/local/apache/htdocs/MiniBlog/user/user_class.php on line 96

The line 96 is in the function of class User:

class User{
    var $reg_time;
    functioin set_regtime($regtime){
                    $this->reg_time=$regtime;
          }
}

I just call the funciton set_regtime like this:

$registtime=(int)date("Y-m-d H:i:s");
$user=new User;
$user->set_regtime($registtime);

The php version is 5.3. Please help me to debug it, Thanks.

A: 

seems like a nesting error, check if all the curly-braces are closed ( { } ) properly!

+6  A: 

What about the spelling mistake?

functioin != function

Christian
Oh, My god! What I'm doing? Thank you very much.
Charlie Epps
haha, looking at code for too long makes your eyes go funny. I've been tripped up on this type of thing many times. :)
Christian
A: 

hahahah dat was soo funny :D i had d same problem "cfunction" woah not complicated is it :)

Zoheb Khan