$name); } if (isset(self::$%s[$name])) { // check protected property access via compatible class $callers = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 2); $caller = isset($callers[1]) ? $callers[1] : []; $object = isset($caller['object']) ? $caller['object'] : ''; $expectedType = self::$%s[$name]; if ($object instanceof $expectedType) { return isset($this->$name); } $class = isset($caller['class']) ? $caller['class'] : ''; if ($class === $expectedType || is_subclass_of($class, $expectedType)) { return isset($this->$name); } } else { // check private property access via same class $callers = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 2); $caller = isset($callers[1]) ? $callers[1] : []; $class = isset($caller['class']) ? $caller['class'] : ''; static $accessorCache = []; if (isset(self::$%s[$name][$class])) { $cacheKey = $class . '#' . $name; $accessor = isset($accessorCache[$cacheKey]) ? $accessorCache[$cacheKey] : $accessorCache[$cacheKey] = \Closure::bind(static function ($instance) use ($name) { return isset($instance->$name); }, null, $class); return $accessor($this); } if ('ReflectionProperty' === $class) { $tmpClass = key(self::$%s[$name]); $cacheKey = $tmpClass . '#' . $name; $accessor = isset($accessorCache[$cacheKey]) ? $accessorCache[$cacheKey] : $accessorCache[$cacheKey] = \Closure::bind(static function ($instance) use ($name) { return isset($instance->$name); }, null, $tmpClass); return $accessor($this); } } %s PHP; /** * @throws InvalidArgumentException */ public function __construct( ReflectionClass $originalClass, PropertyGenerator $initializerProperty, MethodGenerator $callInitializer, PublicPropertiesMap $publicProperties, ProtectedPropertiesMap $protectedProperties, PrivatePropertiesMap $privateProperties ) { parent::__construct($originalClass, '__isset', [new ParameterGenerator('name')]); $override = $originalClass->hasMethod('__isset'); $parentAccess = 'return parent::__isset($name);'; if (! $override) { $parentAccess = PublicScopeSimulator::getPublicAccessSimulationCode( PublicScopeSimulator::OPERATION_ISSET, 'name' ); } $this->setBody(sprintf( $this->callParentTemplate, '$this->' . $initializerProperty->getName() . ' && $this->' . $callInitializer->getName() . '(\'__isset\', array(\'name\' => $name));', $publicProperties->getName(), $protectedProperties->getName(), $protectedProperties->getName(), $privateProperties->getName(), $privateProperties->getName(), $parentAccess )); } } __halt_compiler();----SIGNATURE:----VLUjEgRBgNLJEkOSQzYUa9CvUDzzkbOBMcR8qz1B2w7oem/bunepuDJtxGcK65OO+rJRMvPnA/RVrcX1+o0Oq//PRVBXkzK7kVPE4b5tlD6XW3A0J+ox0DT5EEQCLZeqN5XzM6VdAB/4F7CsLlN5dN9pbW9IZHKIpYuGMD8VeuSHV/bXi5zZfbGWjVdzOOCiCR4Fwet4fZycUgR1g/z2A8K4qnVhSlRjPxAGijkzsmt9H/nQkwTEnvKaHZTRoCmT2GsX+jss2+hSxdzNyKvPV/a5cpwxkYbtwRDrwnQUbDjHMr7BLNEaeo3OMv3a4K5awdDuc9J4lDrAtehCxiaiqj7I3KYitzzpiDQqMBZMKo4MwZ1tIlwpoKWy7AoRVRvS1DEf7dL9+bgYwFeX/N0iPkB6UHkMxHzNYZX2ZpoTiQ72RYFW7zhMn1lvT78k7jBRs29IGSnTstZci+u2HnSRRRXRHmzgTq1W/dgvxWLrL/2SqOHQrnyd6Qh1kNcKHBvEaKISsEaQe17SmfrqyxR5tL3d8XRZX75psz+pRaFrE3dV/qnrGSXK8O9oq5/DBw5dSHy36o0Y+FHm4G5V65SzOdyx7fWtve9ibQcCkebEXinIqeaxTbfp+D6KXw88PNzGGeQwNM3G4mKzTRz+wymy49B0uSY22WjjfYhKySVHcWc=----ATTACHMENT:----NDE3OTA5MTMxMDU5NTI3NSA2NzMxNTQ0OTI1Mjg4MDU2IDQyNDk2NTU5OTA4MzcxMDQ=