Your code is fine. I am guessing that you not put your script under web root so that web server can serve your PHP script.
tell me what is your URL look like for your html form ?
Also, if you include code, use the icon # , < > , and php on the editor to format the code. It will be lots ez to read.
PHP Code:
var $dump = NULL;
Code:
<script>console.log('hi')</script>