--TEST-- Test V8::executeString() : test context preserving --SKIPIF-- --FILE-- ctx = '#1'; try { echo '1. '; $a->executeString($JS_set, 'set.js'); } catch (V8JsException $e) { var_dump($e); } // Second context: Change variable $b = new V8Js(); $b->ctx = '#2'; try { echo '2. '; $b->executeString($JS_change, 'change.js'); } catch (V8JsException $e) { var_dump($e); } // First context: Read variable try { echo '3. '; $a->executeString($JS_read, 'read.js'); } catch (V8JsException $e) { var_dump($e); } // First context: Change variable try { echo '4. '; $a->executeString($JS_change, 'change.js'); } catch (V8JsException $e) { var_dump($e); } // First context: Read variable again try { echo '5. '; $a->executeString($JS_read, 'read.js'); } catch (V8JsException $e) { var_dump($e); } ?> ===EOF=== --EXPECT-- 1. Set variable (#1) 2. Change variable (#2) 3. Read variable (#1) Result: ORIGINAL 4. Change variable (#1) 5. Read variable (#1) Result: CHANGED ===EOF===