소스 검색

Merge pull request #508 from chrisbckr/php82-AllowDynamicProperties

PHP 8.2 compatibility
Stefan Siegl 2 년 전
부모
커밋
293a201d64
3개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      tests/array_access_002.phpt
  2. 2 2
      tests/js-construct-protected-ctor.phpt
  3. 3 1
      v8js_object_export.cc

+ 1 - 0
tests/array_access_002.phpt

@@ -6,6 +6,7 @@ Test V8::executeString() : Use ArrayAccess with JavaScript native push method
 v8js.use_array_access = 1
 v8js.use_array_access = 1
 --FILE--
 --FILE--
 <?php
 <?php
+#[AllowDynamicProperties]
 class MyArray implements ArrayAccess, Countable {
 class MyArray implements ArrayAccess, Countable {
     private $data = Array('one', 'two', 'three');
     private $data = Array('one', 'two', 'three');
 
 

+ 2 - 2
tests/js-construct-protected-ctor.phpt

@@ -52,7 +52,7 @@ object(V8JsScriptException)#%d (13) {
   ["file":protected]=>
   ["file":protected]=>
   string(%d) "%s"
   string(%d) "%s"
   ["line":protected]=>
   ["line":protected]=>
-  int(29)
+  int(%d)
   ["trace":"Exception":private]=>
   ["trace":"Exception":private]=>
   array(1) {
   array(1) {
     [0]=>
     [0]=>
@@ -60,7 +60,7 @@ object(V8JsScriptException)#%d (13) {
       ["file"]=>
       ["file"]=>
       string(%d) "%s"
       string(%d) "%s"
       ["line"]=>
       ["line"]=>
-      int(29)
+      int(%d)
       ["function"]=>
       ["function"]=>
       string(13) "executeString"
       string(13) "executeString"
       ["class"]=>
       ["class"]=>

+ 3 - 1
v8js_object_export.cc

@@ -395,7 +395,9 @@ static void v8js_named_property_enumerator(const v8::PropertyCallbackInfo<v8::Ar
 			IS_MAGIC_FUNC(ZEND_UNSET_FUNC_NAME) ||
 			IS_MAGIC_FUNC(ZEND_UNSET_FUNC_NAME) ||
 			IS_MAGIC_FUNC(ZEND_CALL_FUNC_NAME) ||
 			IS_MAGIC_FUNC(ZEND_CALL_FUNC_NAME) ||
 			IS_MAGIC_FUNC(ZEND_INVOKE_FUNC_NAME) ||
 			IS_MAGIC_FUNC(ZEND_INVOKE_FUNC_NAME) ||
-			IS_MAGIC_FUNC(ZEND_ISSET_FUNC_NAME)) {
+			IS_MAGIC_FUNC(ZEND_ISSET_FUNC_NAME) ||
+			IS_MAGIC_FUNC("__serialize") ||
+			IS_MAGIC_FUNC("__unserialize")) {
 			continue;
 			continue;
 		}
 		}