|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-11-20 19:52 UTC] stesie at brokenpipe dot de
[2015-03-13 14:55 UTC] stesie@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: stesie
[2015-03-13 14:55 UTC] stesie@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 02:00:01 2025 UTC |
Description: ------------ Using the below code, I get the error stated even further down the code. If I call the V8Function closure in TestClass::setMethod(), it will work perfectly. However, when I call it in the global scope (as demonstrated) it will error. It will also error if I call the closure in TestClass::Method() as well. Reproduce code: --------------- class Engine { private $v8; public function __construct() { $this->v8 = new v8js("php"); $this->v8->method = function($c) { TestClass::setMethod($c); }; $this->run(" php.method(function(s) { print(s + '!'); }) "); } public function run($s) { return $this->v8->executeString($s); } } class TestClass { private static $cMethod = null; public static function setMethod(V8Function $cMethod) { self::$cMethod = $cMethod; } public static function Method() { return self::$cMethod; } } $e = new Engine(); $c = TestClass::Method(); echo $c("hello"); # Line number: 54 Expected result: ---------------- hello! Actual result: -------------- PHP Fatal error: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope in /home/Westie/Development/V8Js.php on line 54 PHP Stack trace: PHP 1. {main}() /home/Westie/Development/V8Js.php:0