Skip to content

Commit fab7a68

Browse files
committed
PHP 8.2 compatibility
* tests/array_access_002.phpt - added #[AllowDynamicProperties] to the class MyArray * tests/js-construct-protected-ctor.phpt - some change on how pph8.2 Exepctions references the line that caused the exception, when some call have multiple lines (eg: the executeString in this test), now references the line where the command started (first line) instead of the last line. * V8Js Object Export: added to not enumerate magic methods __serialize and __unserialize - this two methods was added to DateTime objects and was causing tests/var_dump.phpt failing.
1 parent 7515dde commit fab7a68

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/array_access_002.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Test V8::executeString() : Use ArrayAccess with JavaScript native push method
66
v8js.use_array_access = 1
77
--FILE--
88
<?php
9+
#[AllowDynamicProperties]
910
class MyArray implements ArrayAccess, Countable {
1011
private $data = Array('one', 'two', 'three');
1112

tests/js-construct-protected-ctor.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ object(V8JsScriptException)#%d (13) {
5252
["file":protected]=>
5353
string(%d) "%s"
5454
["line":protected]=>
55-
int(29)
55+
int(%d)
5656
["trace":"Exception":private]=>
5757
array(1) {
5858
[0]=>
5959
array(6) {
6060
["file"]=>
6161
string(%d) "%s"
6262
["line"]=>
63-
int(29)
63+
int(%d)
6464
["function"]=>
6565
string(13) "executeString"
6666
["class"]=>

v8js_object_export.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,9 @@ static void v8js_named_property_enumerator(const v8::PropertyCallbackInfo<v8::Ar
395395
IS_MAGIC_FUNC(ZEND_UNSET_FUNC_NAME) ||
396396
IS_MAGIC_FUNC(ZEND_CALL_FUNC_NAME) ||
397397
IS_MAGIC_FUNC(ZEND_INVOKE_FUNC_NAME) ||
398-
IS_MAGIC_FUNC(ZEND_ISSET_FUNC_NAME)) {
398+
IS_MAGIC_FUNC(ZEND_ISSET_FUNC_NAME) ||
399+
IS_MAGIC_FUNC("__serialize") ||
400+
IS_MAGIC_FUNC("__unserialize")) {
399401
continue;
400402
}
401403

0 commit comments

Comments
 (0)