Are you aware that as of a few days ago PhantomJS is effectively unmaintained? It might get a few patches here and there, but I seriously doubt any continuing support for web standards or major bug fixes will happen unless another maintainer steps up.
The previous maintainer of PhantomJS, Vitaly, mentioned that Chrome Headless is nearly ready, and Firefox is also implementing headless mode in a similar way that should be ready this year.
Since the major browsers are supporting headless testing using the WebDriver standard, you should really look to write any new code with a Selenium WebDriver based client, like WebdriverIO, Selenide, or pure Selenium out of the box.
I'd recommend you look elsewhere than PhantomJS, since its core developers acknowledged the effective obsolescence of the project.
Sean