public static function convertUnmappedToPHPValue($value)
    {
        $type  = key($value);
        $value = current($value);

        switch ($type) {
            case 'S':
            case 'B':
            case 'BOOL':
                return $value;
            case 'NULL':
                return null;
            case 'N':
                // Use type coercion to unmarshal numbers to int/float.
                return $value + 0;
            case 'M':
            case 'L':
                foreach ($value as $k => $v) {
                    $value[$k] = self::convertUnmappedToPHPValue($v);
                }

                return $value;
            case 'BS':
            case 'NS':
            case 'SS':
                $childType = substr($type, 0, 1);

                return array_map(
                    function ($childValue) use ($childType) {
                        return self::convertUnmappedToPHPValue([$childType => $childValue]);
                    },
                    $value
                );
        }

        throw new \UnexpectedValueException("Unexpected type: $type.");
    }
public static function convertUnmappedToPHPValue($value)
    {
        $type  = key($value);
        $value = current($value);

        switch ($type) {
            case 'S':
            case 'B':
            case 'BOOL':
                return $value;
            case 'NULL':
                return null;
            case 'N':
                // Use type coercion to unmarshal numbers to int/float.
                return $value + 0;
            case 'M':
            case 'L':
                foreach ($value as $k => $v) {
                    $value[$k] = self::convertUnmappedToPHPValue($v);
                }

                return $value;
            case 'BS':
            case 'NS':
            case 'SS':
                $childType = substr($type, 0, 1);

                return array_map(
                    function ($childValue) use ($childType) {
                        return self::convertUnmappedToPHPValue([$childType => $childValue]);
                    },
                    $value
                );
        }

        throw new \UnexpectedValueException("Unexpected type: $type.");
    }
public static function convertUnmappedToPHPValue ( $ value ) { $ type = key ( $ value ) ; $ value = current ( $ value ) ; switch ( $ type ) { case 'S' : case 'B' : case 'BOOL' : return $ value ; case 'NULL' : return null ; case 'N' : // Use type coercion to unmarshal numbers to int/float. return $ value + 0 ; case 'M' : case 'L' : foreach ( $ value as $ k => $ v ) { $ value [ $ k ] = self :: convertUnmappedToPHPValue ( $ v ) ; } return $ value ; case 'BS' : case 'NS' : case 'SS' : $ childType = substr ( $ type , 0 , 1 ) ; return array_map ( function ( $ childValue ) use ( $ childType ) { return self :: convertUnmappedToPHPValue ( [ $ childType => $ childValue ] ) ; } , $ value ) ; } throw new \ UnexpectedValueException ( "Unexpected type: $type." ) ; }
Child values of a list or map do not have an ODM type mapped, it must be
inferred from the value and DynamoDB data type.

Adapted from {@see \Aws\DynamoDb\Marshaler}.

@param mixed $value

@return mixed The PHP representation of the value.
Child values of a list or map do not have an ODM type mapped it must be inferred from the value and DynamoDB data type .