【发布时间】:2013-11-25 09:56:10
【问题描述】:
我的 Zend 2 项目中有一个 Doctrine 实体,如下所示。
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
use JsonSerializable;
/**
* @ORM\Entity
* @author SWISS BUREAU
*
*/
class ProductVersion implements JsonSerializable
{
/**
* @var $id
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// continue...
// JsonSerializable implementation available below..
我的php版本是
PHP 5.3.3 (cli) (built: Jul 12 2013 20:21:47)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
我在应用程序执行时收到以下错误。
Fatal error: Interface 'JsonSerializable' not found in /var/www/xx.....
可能的原因是什么?我该如何解决这个问题?
【问题讨论】:
标签: php json serialization zend-framework2