3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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.5.38, 5.6.0 - 5.6.38
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.

preferences:
234.5 ms | 402 KiB | 294 Q