Created
May 14, 2011 22:37
-
-
Save yitsushi/972712 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface ILogin { | |
public function check_password( | |
$username, | |
$password, | |
$opts = array() | |
); | |
public function do_login( | |
$username, | |
$password, | |
$opts = array() | |
); | |
public function check_session( | |
$username | |
); | |
} | |
class MyOwnLoginClass implements ILogin { | |
public function ckeck_password( | |
$username, | |
$password, | |
$opts = array() | |
) { | |
} | |
public function do_login( | |
$username, | |
$password | |
) { | |
} | |
} | |
/* | |
* OUTOUT: | |
* | |
* PHP Fatal error: Declaration of MyOwnLoginClass::do_login() | |
* must be compatible with that of ILogin::do_login() | |
* in /Users/yitsushi/a.php on line 8 | |
* | |
* Fatal error: Declaration of MyOwnLoginClass::do_login() | |
* must be compatible with that of ILogin::do_login() | |
* in /Users/yitsushi/a.php on line 8 | |
* | |
* if I fix the parameter error: | |
* PHP Fatal error: Class MyOwnLoginClass contains 2 abstract | |
* methods and must therefore be declared abstract | |
* or implement the remaining methods | |
* (ILogin::check_password, ILogin::check_session) | |
* in /Users/yitsushi/a.php on line 14 | |
* | |
* Fatal error: Class MyOwnLoginClass contains 2 abstract | |
* methods and must therefore be declared abstract | |
* or implement the remaining methods | |
* (ILogin::check_password, ILogin::check_session) | |
* in /Users/yitsushi/a.php on line 14 | |
* | |
* I need a check_session() !!!! | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment