code: private function getScopeClass(&$hist)
      {
          $className = null;
          for ($i = \count($hist) - 1; $i >= 0; $i--) {
              if (\is_object($hist[$i])) {
                  $className = \get_class($hist[$i]);
                  break;
              }
          }
          if ($i < 0) {
              $backtrace = \version_compare(PHP_VERSION, '5.4.0', '>=')
                  ? \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)
                  : \debug_backtrace(false);   // don't provide object
              foreach ($backtrace as $i => $frame) {
                  if (!isset($frame['class']) || \strpos($frame['class'], __NAMESPACE__) !== 0) {
                      break;
                  }
              }
              $className = isset($backtrace[$i]['class'])
                  ? $backtrace[$i]['class']
                  : null;
          }
          return $className;
      }
docs: for nested objects (ie object is a property of an object), returns the parent class
  
  @param array $hist Array & object history
  
  @return null|string