note 107772 deleted from class.jsonserializable by salathe
| From: | salathe@php.net | Date: | Mon, 05 Mar 2012 10:47:10 +0000 |
| Subject: | note 107772 deleted from class.jsonserializable by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-186496@lists.php.net to get a copy of this message | ||
Note Submitter: ideamean at gmail dot com
----
when I use this sample:
class Json extends JsonSerializable{
public function jsonSerialize ( ){
echo 'Hi';
}
}
Then I got a Fatal error:
Fatal error: Class Json cannot extend from interface JsonSerializable
It must use implments :
class Json implements JsonSerializable{
public function jsonSerialize ( ){
echo 'Hi';
}
}
why the php manual tel me it's a "class", but a 'interface':
see:http://cn.php.net/manual/en/class.jsonserializable.php