aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-rpc/php/worker.php
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-php-rpc/php/worker.php')
-rw-r--r--crates/shirabe-php-rpc/php/worker.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/shirabe-php-rpc/php/worker.php b/crates/shirabe-php-rpc/php/worker.php
index 9a36abdd..e82c45ba 100644
--- a/crates/shirabe-php-rpc/php/worker.php
+++ b/crates/shirabe-php-rpc/php/worker.php
@@ -227,6 +227,10 @@ final class ShirabeRpcRuntime
// A natively-constructed dual-mode instance falls through to the P table below.
}
if (is_object($value)) {
+ $materialized = \Shirabe\MaterializedValue::describe($value);
+ if ($materialized !== null) {
+ return array_map([self::class, 'toWire'], $materialized);
+ }
return ShirabePhpObjectRegistry::descriptor($value);
}
if (is_resource($value)) {
@@ -257,6 +261,9 @@ final class ShirabeRpcRuntime
if (isset($value['__pclass']) && count($value) === 1) {
return $value['__pclass'];
}
+ if (isset($value['__pnew'])) {
+ return \Shirabe\MaterializedValue::build(array_map([self::class, 'fromWire'], $value));
+ }
return array_map([self::class, 'fromWire'], $value);
}