note 107772 added to class.jsonserializable

From: Date: Sat, 03 Mar 2012 04:43:39 +0000
Subject: note 107772 added to class.jsonserializable
Groups: php.notes 
Request: Send a blank email to php-notes+get-186476@lists.php.net to get a copy of this message
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 ---- Server IP: 115.182.65.88 Probable Submitter: 113.47.226.176 (proxied: 113.47.226.176) ---- Manual Page -- http://www.php.net/manual/en/class.jsonserializable.php Edit -- https://master.php.net/note/edit/107772 Del: integrated -- https://master.php.net/note/delete/107772/integrated Del: useless -- https://master.php.net/note/delete/107772/useless Del: bad code -- https://master.php.net/note/delete/107772/bad+code Del: spam -- https://master.php.net/note/delete/107772/spam Del: non-english -- https://master.php.net/note/delete/107772/non-english Del: in docs -- https://master.php.net/note/delete/107772/in+docs Del: other reasons-- https://master.php.net/note/delete/107772 Reject -- https://master.php.net/note/reject/107772 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186476) next »