Note that since version 2.0.0 V8Js::registerExtension is deprecated and suggests use snapshots instead https://github.com/phpv8/v8js/releases/tag/2.0.0
Simple example using snapshots and the moment.js:
<?php
$script = file_get_contents('https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js');
$snapshot = V8Js::createSnapshot($script);
$v8 = new V8Js('php', array(), array(), true, $snapshot);
echo $v8->executeString('moment().format()');
?>
Side-note: If you value speed, security and stability do not use file_get_contents to grab external javascripts on production servers.