<?php

class MySecondClass {
    public static function returnHello() {
        return 'Hello';
    }
}

class MyClass {
    protected $_who;
    public function __construct($who) {
        $this->_who = $who;
    }
    public function sayHello() {
        echo MySecondClass::returnHello() . ", {$this->_who}!\n";
    }
}

$ctx = new JSContext();
$ctx->registerClass('MyClass');

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

