3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define('ASSETS'.PUBLIC_PATH,[ 'css' => 'css/', 'js' => 'js/', 'img' => 'img/', ]); var_dump(ASSETS['css']);
based on nD8sI
Output for 7.2.0
Warning: Use of undefined constant PUBLIC_PATH - assumed 'PUBLIC_PATH' (this will throw an Error in a future version of PHP) in /in/bOVWj on line 3 Warning: Use of undefined constant ASSETS - assumed 'ASSETS' (this will throw an Error in a future version of PHP) in /in/bOVWj on line 9 Warning: Illegal string offset 'css' in /in/bOVWj on line 9 string(1) "A"
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant PUBLIC_PATH - assumed 'PUBLIC_PATH' in /in/bOVWj on line 3 Notice: Use of undefined constant ASSETS - assumed 'ASSETS' in /in/bOVWj on line 9 Warning: Illegal string offset 'css' in /in/bOVWj on line 9 string(1) "A"
Output for 5.6.8 - 5.6.28
Notice: Use of undefined constant PUBLIC_PATH - assumed 'PUBLIC_PATH' in /in/bOVWj on line 3 Warning: Constants may only evaluate to scalar values in /in/bOVWj on line 7 Notice: Use of undefined constant ASSETS - assumed 'ASSETS' in /in/bOVWj on line 9 Warning: Illegal string offset 'css' in /in/bOVWj on line 9 string(1) "A"
Output for 5.4.10 - 5.5.35
Parse error: syntax error, unexpected '[' in /in/bOVWj on line 9
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/bOVWj on line 3
Process exited with code 255.