Symfony CSS selector

Code
<?php

use Symfony\Component\CssSelector\CssSelectorConverter;

$xpathStr = (new CssSelectorConverter())->toXpath('h1:first-child');

$file __DIR__ '/templates/site.html';

// ###### using PHP DOM ######

$dom = new DOMDocument();
$dom->loadHTMLFile($file);

$xpath = new DOMXPath($dom);
$domElement $xpath->evaluate($xpathStr)->item(0);

echo 
$domElement->nodeValue PHP_EOL;
Result
PHPSnippets
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6