note 124839 added to class.sessionhandlerinterface
| From: | ohcc at 163 dot com | Date: | Sun, 22 Mar 2020 01:50:10 +0000 |
| Subject: | note 124839 added to class.sessionhandlerinterface | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214355@lists.php.net to get a copy of this message | ||
If you want to use type declarations in your own session handling class, don't
"implements" the SessionHandlerInterface, SessionIdInterface, or
SessinUpdateTimestampInterface, otherwise you will get a fatal error saying that declaration of the
class method must be compatible with the interface method.
a bad example
<?php
class SessionWuXianchengHandler implements SessionHandlerInterface {
public function open(string $sessionPath, string $sessionName) : bool {
}
......
}
?>
a good example
<?php
class SessionWuXianchengHandler {
public function open(string $sessionPath, string $sessionName) : bool {
}
......
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.195 (proxied: 175.155.222.41)
----
Manual Page -- http://php.net/manual/en/class.sessionhandlerinterface.php
Edit -- https://master.php.net/note/edit/124839
Del: integrated -- https://master.php.net/note/delete/124839/integrated
Del: useless -- https://master.php.net/note/delete/124839/useless
Del: bad code -- https://master.php.net/note/delete/124839/bad+code
Del: spam -- https://master.php.net/note/delete/124839/spam
Del: non-english -- https://master.php.net/note/delete/124839/non-english
Del: in docs -- https://master.php.net/note/delete/124839/in+docs
Del: other reasons-- https://master.php.net/note/delete/124839
Reject -- https://master.php.net/note/reject/124839
Search -- https://master.php.net/manage/user-notes.php