You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -393,38 +424,45 @@ protected function &readProperty(&$objectOrArray, $property, $isIndex)
393
424
thrownewPropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $getter, $reflClass->name));
394
425
}
395
426
396
-
$result = $objectOrArray->$getter();
427
+
$result[self::VALUE] = $objectOrArray->$getter();
397
428
} elseif ($reflClass->hasMethod($isser)) {
398
429
if (!$reflClass->getMethod($isser)->isPublic()) {
399
430
thrownewPropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $isser, $reflClass->name));
400
431
}
401
432
402
-
$result = $objectOrArray->$isser();
433
+
$result[self::VALUE] = $objectOrArray->$isser();
403
434
} elseif ($reflClass->hasMethod($hasser)) {
404
435
if (!$reflClass->getMethod($hasser)->isPublic()) {
405
436
thrownewPropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $hasser, $reflClass->name));
406
437
}
407
438
408
-
$result = $objectOrArray->$hasser();
439
+
$result[self::VALUE] = $objectOrArray->$hasser();
409
440
} elseif ($reflClass->hasMethod('__get')) {
410
441
// needed to support magic method __get
411
-
$result = $objectOrArray->$property;
442
+
$result[self::VALUE] = $objectOrArray->$property;
412
443
} elseif ($reflClass->hasProperty($property)) {
413
444
if (!$reflClass->getProperty($property)->isPublic()) {
414
445
thrownewPropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()" or "%s()"?', $property, $reflClass->name, $getter, $isser));
thrownewInvalidPropertyException(sprintf('Neither property "%s" nor method "%s()" nor method "%s()" exists in class "%s"', $property, $getter, $isser, $reflClass->name));
423
456
}
424
457
} else {
425
458
thrownewInvalidPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you should write the property path as "[%s]" instead?', $property, $property));
426
459
}
427
460
461
+
// Objects are always passed around by reference
462
+
if (is_object($result[self::VALUE])) {
463
+
$result[self::IS_REF] = true;
464
+
}
465
+
428
466
return$result;
429
467
}
430
468
@@ -441,7 +479,7 @@ protected function &readProperty(&$objectOrArray, $property, $isIndex)
441
479
* @throws PropertyAccessDeniedException If the property cannot be accessed due to
0 commit comments