diff --git a/tests/commonjs_exception_001.phpt b/tests/commonjs_exception_001.phpt index 4f6a6d72..71ffcb68 100644 --- a/tests/commonjs_exception_001.phpt +++ b/tests/commonjs_exception_001.phpt @@ -20,13 +20,13 @@ $v8->executeString($JS, 'module.js', V8Js::FLAG_PROPAGATE_PHP_EXCEPTIONS); --EXPECTF-- Fatal error: Uncaught Exception: some exception in %s%ecommonjs_exception_001.php:9 Stack trace: -#0 [internal function]: {closure}('test') +#0 [internal function]: {closur%s}('test') #1 %s%ecommonjs_exception_001.php(12): V8Js->executeString('var foo = requi...', 'module.js', 4) #2 {main} Next V8JsScriptException: module.js:1: Exception: some exception in %s%ecommonjs_exception_001.php:9 Stack trace: -#0 [internal function]: {closure}('test') +#0 [internal function]: {closur%s}('test') #1 %s%ecommonjs_exception_001.php(12): V8Js->executeString('var foo = requi...', 'module.js', 4) #2 {main} in %s%ecommonjs_exception_001.php:12 Stack trace: diff --git a/tests/commonjs_exception_002.phpt b/tests/commonjs_exception_002.phpt index 34dd856c..5121546c 100644 --- a/tests/commonjs_exception_002.phpt +++ b/tests/commonjs_exception_002.phpt @@ -23,13 +23,13 @@ $v8->executeString($JS, 'module.js', V8Js::FLAG_PROPAGATE_PHP_EXCEPTIONS); --EXPECTF-- Fatal error: Uncaught Exception: some exception in %s%ecommonjs_exception_002.php:9 Stack trace: -#0 [internal function]: {closure}('', './test') +#0 [internal function]: {closur%s}('', './test') #1 %s%ecommonjs_exception_002.php(15): V8Js->executeString('var foo = requi...', 'module.js', 4) #2 {main} Next V8JsScriptException: module.js:1: Exception: some exception in %s%ecommonjs_exception_002.php:9 Stack trace: -#0 [internal function]: {closure}('', './test') +#0 [internal function]: {closur%s}('', './test') #1 %s%ecommonjs_exception_002.php(15): V8Js->executeString('var foo = requi...', 'module.js', 4) #2 {main} in %s%ecommonjs_exception_002.php:15 Stack trace: diff --git a/tests/commonjs_fatal_error.phpt b/tests/commonjs_fatal_error.phpt index f246adfe..7a06b15d 100644 --- a/tests/commonjs_fatal_error.phpt +++ b/tests/commonjs_fatal_error.phpt @@ -7,7 +7,7 @@ Test V8Js::setModuleLoader : Handle fatal errors gracefully $v8 = new V8Js(); $v8->setModuleLoader(function() { - trigger_error('some fatal error', E_USER_ERROR); + @trigger_error('some fatal error', E_USER_ERROR); }); $v8->executeString(' require("foo"); '); diff --git a/tests/fatal_error_no_uninstall_inner_frame.phpt b/tests/fatal_error_no_uninstall_inner_frame.phpt index f642ceb8..155119a8 100644 --- a/tests/fatal_error_no_uninstall_inner_frame.phpt +++ b/tests/fatal_error_no_uninstall_inner_frame.phpt @@ -29,7 +29,7 @@ nothing. Fatal error: Uncaught Error: Call to a member function foo() on null in %s%efatal_error_no_uninstall_inner_frame.php:15 Stack trace: -#0 [internal function]: {closure}() +#0 [internal function]: {closur%s}() #1 [internal function]: Closure->__invoke() #2 %s%efatal_error_no_uninstall_inner_frame.php(18): V8Js->executeString('PHP.foo();') #3 {main} diff --git a/tests/fatal_error_recursive.phpt b/tests/fatal_error_recursive.phpt index 8fa1d44a..44c4b76b 100644 --- a/tests/fatal_error_recursive.phpt +++ b/tests/fatal_error_recursive.phpt @@ -37,13 +37,13 @@ foo Fatal error: Uncaught Error: Call to a member function bar() on null in %s%efatal_error_recursive.php:7 Stack trace: -#0 [internal function]: {closure}() +#0 [internal function]: {closur%s}() #1 [internal function]: Closure->__invoke() #2 %s%efatal_error_recursive.php(12): V8Js->executeString('PHP.baz();') -#3 [internal function]: {closure}() +#3 [internal function]: {closur%s}() #4 [internal function]: Closure->__invoke() #5 %s%efatal_error_recursive.php(17): V8Js->executeString('PHP.bar();') -#6 [internal function]: {closure}() +#6 [internal function]: {closur%s}() #7 [internal function]: Closure->__invoke() #8 %s%efatal_error_recursive.php(25): V8Js->executeString('PHP.nofail(); P...') #9 {main} diff --git a/tests/fatal_error_rethrow.phpt b/tests/fatal_error_rethrow.phpt index 4459432e..0cf3dd86 100644 --- a/tests/fatal_error_rethrow.phpt +++ b/tests/fatal_error_rethrow.phpt @@ -25,7 +25,7 @@ $js->executeString($script); --EXPECTF-- Fatal error: Uncaught Error: Call to a member function bar() on %s in %s%efatal_error_rethrow.php:7 Stack trace: -#0 [internal function]: {closure}() +#0 [internal function]: {closur%s}() #1 [internal function]: Closure->__invoke() #2 %s%efatal_error_rethrow.php(16): V8Js->executeString(%s) #3 {main} diff --git a/tests/generators_from_v8_008.phpt b/tests/generators_from_v8_008.phpt index 4448a475..8881eb99 100644 --- a/tests/generators_from_v8_008.phpt +++ b/tests/generators_from_v8_008.phpt @@ -37,7 +37,7 @@ int(23) Fatal error: Uncaught Exception: this shall not work in %s Stack trace: -#0 [internal function]: {closure}() +#0 [internal function]: {closur%s}() #1 [internal function]: Closure->__invoke() #2 %s: V8Generator->next() #3 {main} diff --git a/tests/generators_from_v8_009.phpt b/tests/generators_from_v8_009.phpt index ff707d77..ff10bc73 100644 --- a/tests/generators_from_v8_009.phpt +++ b/tests/generators_from_v8_009.phpt @@ -22,7 +22,7 @@ EOJS; $v8 = new V8Js(); $v8->getValue = function() { - trigger_error("you're gonna fail now", E_USER_ERROR); + @trigger_error("you're gonna fail now", E_USER_ERROR); }; $gen = $v8->executeString($js); diff --git a/tests/var_dump.phpt b/tests/var_dump.phpt index cc0654cb..9097ca9e 100644 --- a/tests/var_dump.phpt +++ b/tests/var_dump.phpt @@ -1,7 +1,10 @@ --TEST-- Test V8::executeString() : var_dump --SKIPIF-- - += 8.4'); +?> --INI-- date.timezone=UTC --FILE-- @@ -70,254 +73,266 @@ try { } ?> ===EOF=== ---EXPECTREGEX-- -\-\-\-\- PHP var_dump of PHP object \-\-\-\- -array\(11\) \{ - \["null"\]\=\> +--EXPECTF-- +---- PHP var_dump of PHP object ---- +array(11) { + ["null"]=> NULL - \["bool"\]\=\> - bool\(true\) - \["string"\]\=\> - string\(6\) "string" - \["uint"\]\=\> - int\(1\) - \["int"\]\=\> - int\(\-1\) - \["number"\]\=\> - float\(3\.141592654\) - \["date"\]\=\> - object\(DateTime\)\#\d+ \(3\) \{ - \["date"\]\=\> - string\(\d+\) "1976\-09\-27 09\:00\:00((\.0+)?)" - \["timezone_type"\]\=\> - int\(3\) - \["timezone"\]\=\> - string\(3\) "UTC" - \} - \["array"\]\=\> - array\(3\) \{ - \[0\]\=\> - int\(1\) - \[1\]\=\> - int\(2\) - \[2\]\=\> - int\(3\) - \} - \["object"\]\=\> - array\(1\) \{ - \["field"\]\=\> - string\(3\) "foo" - \} - \["function"\]\=\> - object\(Closure\)\#\d+ \(1\) \{ - \["parameter"\]\=\> - array\(1\) \{ - \["\$x"\]\=\> - string\(10\) "\" - \} - \} - \["phpobject"\]\=\> - object\(Foo\)\#\d+ \(1\) \{ - \["field"\]\=\> - string\(3\) "php" - \} -\} -\-\-\- JS var_dump of PHP object \-\-\-\- -array \(11\) \{ - \["null"\] \=\> + ["bool"]=> + bool(true) + ["string"]=> + string(6) "string" + ["uint"]=> + int(1) + ["int"]=> + int(-1) + ["number"]=> + float(3.141592654) + ["date"]=> + object(DateTime)#3 (3) { + ["date"]=> + string(26) "1976-09-27 09:00:00.000000" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" + } + ["array"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["object"]=> + array(1) { + ["field"]=> + string(3) "foo" + } + ["function"]=> + object(Closure)#4 (4) { + ["name"]=> + string(45) "{closure:/tmp/php-v8js/tests/var_dump.php:51}" + ["file"]=> + string(32) "/tmp/php-v8js/tests/var_dump.php" + ["line"]=> + int(51) + ["parameter"]=> + array(1) { + ["$x"]=> + string(10) "" + } + } + ["phpobject"]=> + object(Foo)#5 (1) { + ["field"]=> + string(3) "php" + } +} +--- JS var_dump of PHP object ---- +array (11) { + ["null"] => NULL - \["bool"\] \=\> - bool\(true\) - \["string"\] \=\> - string\(6\) "string" - \["uint"\] \=\> - int\(1\) - \["int"\] \=\> - int\(\-1\) - \["number"\] \=\> - float\(3\.141593\) - \["date"\] \=\> - object\(DateTime\)\#\d+ \(\d+\) \{(?: - \["createFromImmutable"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \})?(?: - \["createFromInterface"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \})? - \["createFromFormat"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["getLastErrors"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["format"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["modify"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["add"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["sub"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["getTimezone"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["setTimezone"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["getOffset"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["setTime"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["setDate"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["setISODate"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["setTimestamp"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["getTimestamp"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \} - \["diff"\] \=\> - object\(Closure\)\#\d+ \{ - function \(\) \{ \[native code\] \} - \}(?:(?:the following block is missing from PHP 7.4 on){0} - \["\$date"\] \=\> - string\(\d+\) "1976\-09\-27 09\:00\:00((\.0+)?)" - \["\$timezone_type"\] \=\> - int\(3\) - \["\$timezone"\] \=\> - string\(3\) "UTC" - )?\s*\} - \["array"\] \=\> - array\(3\) \{ - \[0\] \=\> - int\(1\) - \[1\] \=\> - int\(2\) - \[2\] \=\> - int\(3\) - \} - \["object"\] \=\> - array \(1\) \{ - \["field"\] \=\> - string\(3\) "foo" - \} - \["function"\] \=\> - object\(Closure\)\#\d+ \(0\) \{ - \} - \["phpobject"\] \=\> - object\(Foo\)\#\d+ \(1\) \{ - \["\$field"\] \=\> - string\(3\) "php" - \} -\} -\-\-\- JS var_dump of JS object \-\-\-\- -object\(Object\)\#\d+ \(12\) \{ - \["undefined"\] \=\> + ["bool"] => + bool(true) + ["string"] => + string(6) "string" + ["uint"] => + int(1) + ["int"] => + int(-1) + ["number"] => + float(3.141593) + ["date"] => + object(DateTime)#%d (20) { + ["createFromImmutable"] => + object(Closure)#%d { + function () { [native code] } + } + ["createFromInterface"] => + object(Closure)#%d { + function () { [native code] } + } + ["createFromFormat"] => + object(Closure)#%d { + function () { [native code] } + } + ["createFromTimestamp"] => + object(Closure)#%d { + function () { [native code] } + } + ["getLastErrors"] => + object(Closure)#%d { + function () { [native code] } + } + ["format"] => + object(Closure)#%d { + function () { [native code] } + } + ["modify"] => + object(Closure)#%d { + function () { [native code] } + } + ["add"] => + object(Closure)#%d { + function () { [native code] } + } + ["sub"] => + object(Closure)#%d { + function () { [native code] } + } + ["getTimezone"] => + object(Closure)#%d { + function () { [native code] } + } + ["setTimezone"] => + object(Closure)#%d { + function () { [native code] } + } + ["getOffset"] => + object(Closure)#%d { + function () { [native code] } + } + ["getMicrosecond"] => + object(Closure)#%d { + function () { [native code] } + } + ["setTime"] => + object(Closure)#%d { + function () { [native code] } + } + ["setDate"] => + object(Closure)#%d { + function () { [native code] } + } + ["setISODate"] => + object(Closure)#%d { + function () { [native code] } + } + ["setTimestamp"] => + object(Closure)#%d { + function () { [native code] } + } + ["setMicrosecond"] => + object(Closure)#%d { + function () { [native code] } + } + ["getTimestamp"] => + object(Closure)#%d { + function () { [native code] } + } + ["diff"] => + object(Closure)#%d { + function () { [native code] } + } + } + ["array"] => + array(3) { + [0] => + int(1) + [1] => + int(2) + [2] => + int(3) + } + ["object"] => + array (1) { + ["field"] => + string(3) "foo" + } + ["function"] => + object(Closure)#%d (0) { + } + ["phpobject"] => + object(Foo)#%d (1) { + ["$field"] => + string(3) "php" + } +} +--- JS var_dump of JS object ---- +object(Object)#%d (12) { + ["undefined"] => NULL - \["null"\] \=\> + ["null"] => NULL - \["bool"\] \=\> - bool\(true\) - \["string"\] \=\> - string\(6\) "string" - \["uint"\] \=\> - int\(1\) - \["int"\] \=\> - int\(\-1\) - \["number"\] \=\> - float\(3\.141593\) - \["regexp"\] \=\> - regexp\(\/regexp\/\) - \["array"\] \=\> - array\(3\) \{ - \[0\] \=\> - int\(1\) - \[1\] \=\> - int\(2\) - \[2\] \=\> - int\(3\) - \} - \["object"\] \=\> - object\(Object\)\#\d+ \(1\) \{ - \["field"\] \=\> - string\(3\) "foo" - \} - \["function"\] \=\> - object\(Closure\)\#\d+ \{ - function id\(x\) \{ return x; \} - \} - \["phpobject"\] \=\> - object\(Foo\)\#\d+ \(1\) \{ - \["\$field"\] \=\> - string\(3\) "php" - \} -\} -\-\-\- PHP var_dump of JS object \-\-\-\- -object\(V8Object\)\#\d+ \(12\) \{ - \["undefined"\]\=\> + ["bool"] => + bool(true) + ["string"] => + string(6) "string" + ["uint"] => + int(1) + ["int"] => + int(-1) + ["number"] => + float(3.141593) + ["regexp"] => + regexp(/regexp/) + ["array"] => + array(3) { + [0] => + int(1) + [1] => + int(2) + [2] => + int(3) + } + ["object"] => + object(Object)#%d (1) { + ["field"] => + string(3) "foo" + } + ["function"] => + object(Closure)#%d { + function id(x) { return x; } + } + ["phpobject"] => + object(Foo)#%d (1) { + ["$field"] => + string(3) "php" + } +} +--- PHP var_dump of JS object ---- +object(V8Object)#6 (12) { + ["undefined"]=> NULL - \["null"\]\=\> + ["null"]=> NULL - \["bool"\]\=\> - bool\(true\) - \["string"\]\=\> - string\(6\) "string" - \["uint"\]\=\> - int\(1\) - \["int"\]\=\> - int\(\-1\) - \["number"\]\=\> - float\(3\.141592654\) - \["regexp"\]\=\> - object\(V8Object\)\#\d+ \(0\) \{ - \} - \["array"\]\=\> - array\(3\) \{ - \[0\]\=\> - int\(1\) - \[1\]\=\> - int\(2\) - \[2\]\=\> - int\(3\) - \} - \["object"\]\=\> - object\(V8Object\)\#\d+ \(1\) \{ - \["field"\]\=\> - string\(3\) "foo" - \} - \["function"\]\=\> - object\(V8Function\)\#\d+ \(0\) \{ - \} - \["phpobject"\]\=\> - object\(Foo\)\#\d+ \(1\) \{ - \["field"\]\=\> - string\(3\) "php" - \} -\} -\=\=\=EOF\=\=\= + ["bool"]=> + bool(true) + ["string"]=> + string(6) "string" + ["uint"]=> + int(1) + ["int"]=> + int(-1) + ["number"]=> + float(3.141592654) + ["regexp"]=> + object(V8Object)#7 (0) { + } + ["array"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["object"]=> + object(V8Object)#8 (1) { + ["field"]=> + string(3) "foo" + } + ["function"]=> + object(V8Function)#9 (0) { + } + ["phpobject"]=> + object(Foo)#2 (1) { + ["field"]=> + string(3) "php" + } +} +===EOF=== diff --git a/tests/var_dump_php83.phpt b/tests/var_dump_php83.phpt new file mode 100644 index 00000000..e78c5fd5 --- /dev/null +++ b/tests/var_dump_php83.phpt @@ -0,0 +1,326 @@ +--TEST-- +Test V8::executeString() : var_dump +--SKIPIF-- += 80400) die('skip Only for php version < 8.4'); +?> +--INI-- +date.timezone=UTC +--FILE-- +obj = new Foo; + +$phptypes = $v8->phptypes = array( + "null" => NULL, + "bool" => true, + "string" => "string", + "uint" => 1, + "int" => -1, + "number" => 3.141592654, + "date" => new DateTime('September 27, 1976 09:00:00 UTC', new DateTimeZone('UTC')), + //"regexp" => new Regexp('/regexp/'), /* no native PHP regex type */ + "array" => array(1,2,3), + "object" => array( "field" => "foo" ), + "function" => (function ($x) { return $x; }), + "phpobject" => new Foo +); + +echo "---- PHP var_dump of PHP object ----\n"; +var_dump($phptypes); + +try { + var_dump($v8->executeString($JS, 'var_dump.js')); +} catch (V8JsScriptException $e) { + echo "Error!\n"; + var_dump($e); +} +?> +===EOF=== +--EXPECTREGEX-- +\-\-\-\- PHP var_dump of PHP object \-\-\-\- +array\(11\) \{ + \["null"\]\=\> + NULL + \["bool"\]\=\> + bool\(true\) + \["string"\]\=\> + string\(6\) "string" + \["uint"\]\=\> + int\(1\) + \["int"\]\=\> + int\(\-1\) + \["number"\]\=\> + float\(3\.141592654\) + \["date"\]\=\> + object\(DateTime\)\#\d+ \(3\) \{ + \["date"\]\=\> + string\(\d+\) "1976\-09\-27 09\:00\:00((\.0+)?)" + \["timezone_type"\]\=\> + int\(3\) + \["timezone"\]\=\> + string\(3\) "UTC" + \} + \["array"\]\=\> + array\(3\) \{ + \[0\]\=\> + int\(1\) + \[1\]\=\> + int\(2\) + \[2\]\=\> + int\(3\) + \} + \["object"\]\=\> + array\(1\) \{ + \["field"\]\=\> + string\(3\) "foo" + \} + \["function"\]\=\> + object\(Closure\)\#\d+ \(1\) \{ + \["parameter"\]\=\> + array\(1\) \{ + \["\$x"\]\=\> + string\(10\) "\" + \} + \} + \["phpobject"\]\=\> + object\(Foo\)\#\d+ \(1\) \{ + \["field"\]\=\> + string\(3\) "php" + \} +\} +\-\-\- JS var_dump of PHP object \-\-\-\- +array \(11\) \{ + \["null"\] \=\> + NULL + \["bool"\] \=\> + bool\(true\) + \["string"\] \=\> + string\(6\) "string" + \["uint"\] \=\> + int\(1\) + \["int"\] \=\> + int\(\-1\) + \["number"\] \=\> + float\(3\.141593\) + \["date"\] \=\> + object\(DateTime\)\#\d+ \(\d+\) \{(?: + \["createFromImmutable"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \})?(?: + \["createFromInterface"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \})? + \["createFromFormat"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["getLastErrors"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["format"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["modify"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["add"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["sub"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["getTimezone"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["setTimezone"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["getOffset"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["setTime"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["setDate"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["setISODate"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["setTimestamp"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["getTimestamp"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \} + \["diff"\] \=\> + object\(Closure\)\#\d+ \{ + function \(\) \{ \[native code\] \} + \}(?:(?:the following block is missing from PHP 7.4 on){0} + \["\$date"\] \=\> + string\(\d+\) "1976\-09\-27 09\:00\:00((\.0+)?)" + \["\$timezone_type"\] \=\> + int\(3\) + \["\$timezone"\] \=\> + string\(3\) "UTC" + )?\s*\} + \["array"\] \=\> + array\(3\) \{ + \[0\] \=\> + int\(1\) + \[1\] \=\> + int\(2\) + \[2\] \=\> + int\(3\) + \} + \["object"\] \=\> + array \(1\) \{ + \["field"\] \=\> + string\(3\) "foo" + \} + \["function"\] \=\> + object\(Closure\)\#\d+ \(0\) \{ + \} + \["phpobject"\] \=\> + object\(Foo\)\#\d+ \(1\) \{ + \["\$field"\] \=\> + string\(3\) "php" + \} +\} +\-\-\- JS var_dump of JS object \-\-\-\- +object\(Object\)\#\d+ \(12\) \{ + \["undefined"\] \=\> + NULL + \["null"\] \=\> + NULL + \["bool"\] \=\> + bool\(true\) + \["string"\] \=\> + string\(6\) "string" + \["uint"\] \=\> + int\(1\) + \["int"\] \=\> + int\(\-1\) + \["number"\] \=\> + float\(3\.141593\) + \["regexp"\] \=\> + regexp\(\/regexp\/\) + \["array"\] \=\> + array\(3\) \{ + \[0\] \=\> + int\(1\) + \[1\] \=\> + int\(2\) + \[2\] \=\> + int\(3\) + \} + \["object"\] \=\> + object\(Object\)\#\d+ \(1\) \{ + \["field"\] \=\> + string\(3\) "foo" + \} + \["function"\] \=\> + object\(Closure\)\#\d+ \{ + function id\(x\) \{ return x; \} + \} + \["phpobject"\] \=\> + object\(Foo\)\#\d+ \(1\) \{ + \["\$field"\] \=\> + string\(3\) "php" + \} +\} +\-\-\- PHP var_dump of JS object \-\-\-\- +object\(V8Object\)\#\d+ \(12\) \{ + \["undefined"\]\=\> + NULL + \["null"\]\=\> + NULL + \["bool"\]\=\> + bool\(true\) + \["string"\]\=\> + string\(6\) "string" + \["uint"\]\=\> + int\(1\) + \["int"\]\=\> + int\(\-1\) + \["number"\]\=\> + float\(3\.141592654\) + \["regexp"\]\=\> + object\(V8Object\)\#\d+ \(0\) \{ + \} + \["array"\]\=\> + array\(3\) \{ + \[0\]\=\> + int\(1\) + \[1\]\=\> + int\(2\) + \[2\]\=\> + int\(3\) + \} + \["object"\]\=\> + object\(V8Object\)\#\d+ \(1\) \{ + \["field"\]\=\> + string\(3\) "foo" + \} + \["function"\]\=\> + object\(V8Function\)\#\d+ \(0\) \{ + \} + \["phpobject"\]\=\> + object\(Foo\)\#\d+ \(1\) \{ + \["field"\]\=\> + string\(3\) "php" + \} +\} +\=\=\=EOF\=\=\= diff --git a/v8js_object_export.cc b/v8js_object_export.cc index 2792058c..8027d380 100644 --- a/v8js_object_export.cc +++ b/v8js_object_export.cc @@ -675,7 +675,7 @@ v8::Local v8js_named_property_callback(v8::Isolate *isolate, v8::Loca ce = scope = object->ce; /* First, check the (case-insensitive) method table */ - php_strtolower(lower, name_len); + zend_str_tolower(lower, name_len); method_name = zend_string_init(lower, name_len, 0); // toString() -> __tostring()