3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface solr_json_build { function to_json(); } class ror_service_recommend implements solr_json_build { //推荐页按产品分类和预订城市进行搜索 public $ids; public $bookCityCode; public $terminalType; public $queryFields; // 过滤价格为0线路 public $priceLimit = true; public function __construct(){} public function to_jsonnnn() { $json = array(); foreach (get_class_vars(__CLASS__) as $field => $value) { $this->{$field} && $json[$field] = $this->{$field}; } return json_encode($json); } } $o = new ror_service_recommend(); print_r($o);
based on fiq5k
Output for 7.0.0 - 7.2.0
Fatal error: Class ror_service_recommend contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (solr_json_build::to_json) in /in/3DAsR on line 8
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Class ror_service_recommend contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (solr_json_build::to_json) in /in/3DAsR on line 34
Process exited with code 255.