<?php
$ctx = new JSContext();

$ctx->registerClass('DOMDocument');
$ctx->registerClass('DOMXPath');

$ctx->registerFunction(function ($str) {echo $str;}, 'print');  // Pour faciliter les affichages
$ctx->registerFunction('var_dump');                             // Et le debuggage

$js = file_get_contents(__DIR__ . '/registerClass.js');
$ctx->evaluateScript($js);

