It does eliminate the error messages.
There's a syntax error in the code in the PDF file - it's missing the last line. It should have a close paren and comma. Adding a little more information about where in the file to add the code would be helpful to those who aren't PHP coders.