3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Only in production mode. error_reporting(0); define('DS', DIRECTORY_SEPARATOR); define('ROOT', dirname(__FILE__) . DS); // ROOT is php_js/ folder ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CookieLayerHelper PHP, HTML, JS, CSS</title> </head> <body> <h1>CookieLayerHelper PHP, HTML, JS, CSS</h1> <script type="text/javascript" src="./js/jquery-1.11.1.min.js"></script> <?php require_once ROOT . DS . 'Helper' . DS .'CookieLayerHelper.php'; $settings = array( 'locale' => 'pt_PT', 'mode' => 'normal', // normal: shows understood button and include all cookies without ask. 'onAceptClick' => ' /* Instead of load the source code via CookieLayerLoader.js, here you can include more source code. */ alert(\'Agree. Code injected from settings =)\'); ', 'onDisagreeClick' => ' /* Here you can include code that is going to execute when disagree button was pressed */ alert(\'Disagree. Code injected from settings =)\'); ' ); try{ $CookieLayerHelper = new CookieLayerHelper($settings); $CookieLayerHelper->render(); } catch (Exception $e){ echo $e->getMessage(); } ?> </body> </html>
Output for 5.0.0 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CookieLayerHelper PHP, HTML, JS, CSS</title> </head> <body> <h1>CookieLayerHelper PHP, HTML, JS, CSS</h1> <script type="text/javascript" src="./js/jquery-1.11.1.min.js"></script>
Process exited with code 255.
Output for hhvm-3.13.2
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CookieLayerHelper PHP, HTML, JS, CSS</title> </head> <body> <h1>CookieLayerHelper PHP, HTML, JS, CSS</h1> <script type="text/javascript" src="./js/jquery-1.11.1.min.js"></script> Fatal error: Uncaught Error: require_once(/in//Helper/CookieLayerHelper.php): File not found in /in/RWXVq:23 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.12.0
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CookieLayerHelper PHP, HTML, JS, CSS</title> </head> <body> <h1>CookieLayerHelper PHP, HTML, JS, CSS</h1> <script type="text/javascript" src="./js/jquery-1.11.1.min.js"></script> Fatal error: Uncaught Error: File not found: /in//Helper/CookieLayerHelper.php in /in/RWXVq:23 Stack trace: #0 {main}
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/RWXVq on line 42
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/RWXVq on line 42
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/RWXVq on line 42
Process exited with code 255.