public static function set($object, $property, $value)
    {
        $property = self::getReflectionProperty($object, $property);

        if (is_string($object) || $property->isStatic()) {
            if (($declaringClass = $property->getDeclaringClass()->getName()) !== self::toClassName($object)) {
                self::getReflectionProperty($declaringClass, $property->getName())->setValue(null, $value);
                return;
            }

            $property->setValue(null, $value);
            return;
        }

        $property->setValue($object, $value);
    }
public static function set($object, $property, $value)
    {
        $property = self::getReflectionProperty($object, $property);

        if (is_string($object) || $property->isStatic()) {
            if (($declaringClass = $property->getDeclaringClass()->getName()) !== self::toClassName($object)) {
                self::getReflectionProperty($declaringClass, $property->getName())->setValue(null, $value);
                return;
            }

            $property->setValue(null, $value);
            return;
        }

        $property->setValue($object, $value);
    }
public static function set ( $ object , $ property , $ value ) { $ property = self :: getReflectionProperty ( $ object , $ property ) ; if ( is_string ( $ object ) || $ property -> isStatic ( ) ) { if ( ( $ declaringClass = $ property -> getDeclaringClass ( ) -> getName ( ) ) !== self :: toClassName ( $ object ) ) { self :: getReflectionProperty ( $ declaringClass , $ property -> getName ( ) ) -> setValue ( null , $ value ) ; return ; } $ property -> setValue ( null , $ value ) ; return ; } $ property -> setValue ( $ object , $ value ) ; }
Set the value of a property of an object or a class

@param string|object $object
@param string $property
@param mixed  $value
Set the value of a property of an object or a class