Skip to content

Commit

Permalink
PHP 8.2 compatibility
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
chrisbckr committed Feb 20, 2023
1 parent 7515dde commit fab7a68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/array_access_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Test V8::executeString() : Use ArrayAccess with JavaScript native push method
v8js.use_array_access = 1
--FILE--
<?php
#[AllowDynamicProperties]
class MyArray implements ArrayAccess, Countable {
private $data = Array('one', 'two', 'three');

Expand Down
4 changes: 2 additions & 2 deletions tests/js-construct-protected-ctor.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ object(V8JsScriptException)#%d (13) {
["file":protected]=>
string(%d) "%s"
["line":protected]=>
int(29)
int(%d)
["trace":"Exception":private]=>
array(1) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(29)
int(%d)
["function"]=>
string(13) "executeString"
["class"]=>
Expand Down
4 changes: 3 additions & 1 deletion v8js_object_export.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_CALL_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;
}

Expand Down

0 comments on commit fab7a68

Please sign in to comment.