3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Qihoo\Controller\Decorator; use Beahoo\Controller\Request; use Beahoo\Controller\Response; /** * 前端JSONP回调函数装饰器 * * @package Qihoo\Controller\Decorator */ class CallbackDecorator extends \Beahoo\Controller\Decorator { /** * 执行 * * @param \Beahoo\Controller\Request $request * @param \Beahoo\Controller\Response $response * * @result void */ public function execute(Request $request, Response $response) { parent::execute($request, $response); $callback = $request->getQueryArg('callback'); if ($callback && preg_match('/^[\._a-z0-9]+$/i', $callback)) { $body = $response->getBody(); if (is_array($body)) { $body = json_encode($body); } $body = "{$callback}({$body})"; $response->setBody($body); } } }
Output for 7.0.0 - 7.1.0
Fatal error: Class 'Beahoo\Controller\Decorator' not found in /in/hEo4g on line 13
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Class 'Beahoo\Controller\Decorator' not found in /in/hEo4g on line 14
Process exited with code 255.