original_string: private function readProperty($zval, $property, bool $ignoreInvalidProperty = false)
      {
          if (!\is_object($zval[self::VALUE])) {
              throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.', $property));
          }
  
          $result = self::$resultProto;
          $object = $zval[self::VALUE];
          $access = $this->getReadAccessInfo(\get_class($object), $property);
  
          if (self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]) {
              $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();
          } elseif (self::ACCESS_TYPE_PROPERTY === $access[self::ACCESS_TYPE]) {
              $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]};
  
              if ($access[self::ACCESS_REF] && isset($zval[self::REF])) {
                  $result[self::REF] = &$object->{$access[self::ACCESS_NAME]};
              }
          } elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) {
              // Needed to support \stdClass instances. We need to explicitly
              // exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if
              // a *protected* property was found on the class, property_exists()
              // returns true, consequently the following line will result in a
              // fatal error.
  
              $result[self::VALUE] = $object->$property;
              if (isset($zval[self::REF])) {
                  $result[self::REF] = &$object->$property;
              }
          } elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
              // we call the getter and hope the __call do the job
              $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();
          } elseif (!$ignoreInvalidProperty) {
              throw new NoSuchPropertyException($access[self::ACCESS_NAME]);
          }
  
          // Objects are always passed around by reference
          if (isset($zval[self::REF]) && \is_object($result[self::VALUE])) {
              $result[self::REF] = $result[self::VALUE];
          }
  
          return $result;
      }
code: private function readProperty($zval, $property, bool $ignoreInvalidProperty = false)
      {
          if (!\is_object($zval[self::VALUE])) {
              throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.', $property));
          }
  
          $result = self::$resultProto;
          $object = $zval[self::VALUE];
          $access = $this->getReadAccessInfo(\get_class($object), $property);
  
          if (self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]) {
              $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();
          } elseif (self::ACCESS_TYPE_PROPERTY === $access[self::ACCESS_TYPE]) {
              $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]};
  
              if ($access[self::ACCESS_REF] && isset($zval[self::REF])) {
                  $result[self::REF] = &$object->{$access[self::ACCESS_NAME]};
              }
          } elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) {
              // Needed to support \stdClass instances. We need to explicitly
              // exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if
              // a *protected* property was found on the class, property_exists()
              // returns true, consequently the following line will result in a
              // fatal error.
  
              $result[self::VALUE] = $object->$property;
              if (isset($zval[self::REF])) {
                  $result[self::REF] = &$object->$property;
              }
          } elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
              // we call the getter and hope the __call do the job
              $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();
          } elseif (!$ignoreInvalidProperty) {
              throw new NoSuchPropertyException($access[self::ACCESS_NAME]);
          }
  
          // Objects are always passed around by reference
          if (isset($zval[self::REF]) && \is_object($result[self::VALUE])) {
              $result[self::REF] = $result[self::VALUE];
          }
  
          return $result;
      }
code_tokens: private function readProperty ( $ zval , $ property , bool $ ignoreInvalidProperty = false ) { if ( ! \ is_object ( $ zval [ self :: VALUE ] ) ) { throw new NoSuchPropertyException ( sprintf ( 'Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.' , $ property ) ) ; } $ result = self :: $ resultProto ; $ object = $ zval [ self :: VALUE ] ; $ access = $ this -> getReadAccessInfo ( \ get_class ( $ object ) , $ property ) ; if ( self :: ACCESS_TYPE_METHOD === $ access [ self :: ACCESS_TYPE ] ) { $ result [ self :: VALUE ] = $ object -> { $ access [ self :: ACCESS_NAME ] } ( ) ; } elseif ( self :: ACCESS_TYPE_PROPERTY === $ access [ self :: ACCESS_TYPE ] ) { $ result [ self :: VALUE ] = $ object -> { $ access [ self :: ACCESS_NAME ] } ; if ( $ access [ self :: ACCESS_REF ] && isset ( $ zval [ self :: REF ] ) ) { $ result [ self :: REF ] = & $ object -> { $ access [ self :: ACCESS_NAME ] } ; } } elseif ( ! $ access [ self :: ACCESS_HAS_PROPERTY ] && property_exists ( $ object , $ property ) ) { // Needed to support \stdClass instances. We need to explicitly // exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if // a *protected* property was found on the class, property_exists() // returns true, consequently the following line will result in a // fatal error. $ result [ self :: VALUE ] = $ object -> $ property ; if ( isset ( $ zval [ self :: REF ] ) ) { $ result [ self :: REF ] = & $ object -> $ property ; } } elseif ( self :: ACCESS_TYPE_MAGIC === $ access [ self :: ACCESS_TYPE ] ) { // we call the getter and hope the __call do the job $ result [ self :: VALUE ] = $ object -> { $ access [ self :: ACCESS_NAME ] } ( ) ; } elseif ( ! $ ignoreInvalidProperty ) { throw new NoSuchPropertyException ( $ access [ self :: ACCESS_NAME ] ) ; } // Objects are always passed around by reference if ( isset ( $ zval [ self :: REF ] ) && \ is_object ( $ result [ self :: VALUE ] ) ) { $ result [ self :: REF ] = $ result [ self :: VALUE ] ; } return $ result ; }
docstring: Reads the a property from an object.
  
  @param array  $zval                  The array containing the object to read from
  @param string $property              The property to read
  @param bool   $ignoreInvalidProperty Whether to ignore invalid property or throw an exception
  
  @return array The array containing the value of the property
  
  @throws NoSuchPropertyException If $ignoreInvalidProperty is false and the property does not exist or is not public
docstring_tokens: Reads the a property from an object .