Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1001489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:40:52+00:00 2026-05-16T07:40:52+00:00

I’m getting an Illegal offset type for this array: public static $CATS_AND_TYPES = array(

  • 0

I’m getting an “Illegal offset type” for this array:

public static $CATS_AND_TYPES = array(

        // Statement Administration
        array( self::CAT_STATEMENT_ADMIN => "Document Administration" ) => array(
            self::TYPE_STATEMENTS_LOADED => "Documents Loaded",
            self::TYPE_STATEMENTS_REMOVED => "Documents Removed"
        ),

        // Cron Jobs
        array( self::CAT_CRON_JOBS => "Cron Jobs" ) => array(
            self::TYPE_CRON_BULLETIN_RUN => "Bulletin Cron Job Ran",
            self::TYPE_CRON_EMAILER_RUN => "Emailer Cron Job Ran",
            self::TYPE_CRON_SURVEY_RUN => "Survey Cron Job Ran",
            self::TYPE_CRON_JOURNEY_RUN => "Journey Cron Job Ran",
            self::TYPE_CRON_DOCUMENT_RUN => "Document Cron Job Ran"
        ),

        // Global Administration
        array( self::CAT_GLOBAL_ADMIN => "Global Administration" ) => array(
            self::TYPE_GLOBAL_MAINTENANCE => "Global Maintenance",
            self::TYPE_GLOBAL_EMAIL_SENDING => "Email Sending"
        ),

        // Email Administration
        array( self::CAT_EMAIL_ADMIN => "Email Administration" ) => array(
            self::TYPE_EMAIL_SENT => "Email Sent",
            self::TYPE_EMAIL_RESENT => "Email Resent",
            self::TYPE_EMAIL_REMOVED => "Email Removed"
        ),

        // DCVs Administration
        array( self::CAT_DCVS_ADMIN => "DCVs Administration" ) => array(
            self::TYPE_DCVS_FLEX_UPDATED => "Flexible Variables Updated",
            self::TYPE_DCVS_GLOBAL_UPDATED => "Global Variables Updated"
        ),

        // Video Administration
        array( self::CAT_VIDEO_ADMIN => "Video Administration" ) => array(
            self::TYPE_VIDEO_ADDED => "Video Added",
            self::TYPE_VIDEO_EDITED => "Video Edited",
            self::TYPE_VIDEO_REMOVED => "Video Removed"
        ),

        // Bulletin Board Administration
        array( self::CAT_BULLETIN_BOARD => "Bulletin Board Administration" ) => array(
            self::TYPE_BULLETIN_DELETED => "Message Deleted",
            self::TYPE_BULLETIN_EDITED => "Message Edited",
            self::TYPE_BULLETIN_ADDED => "Message Added"
        ),

        // User Administration
        array( self::CAT_USER_ADMIN => "User Administration" ) => array(
            self::TYPE_USER_ADDED => "User Added",
            self::TYPE_USER_ADDED_MULTI => "Multiple Users Added",
            self::TYPE_USER_REMOVED => "User Removed",
            self::TYPE_USER_REMOVED_MULTI => "Multiple Users Removed",
            self::TYPE_USER_UPDATED => "User Updated"
        ),

        // Survey Administration
        array( self::CAT_SURVEY_ADMIN => "Survey Administration" ) => array(
            self::TYPE_SURVEY_ADDED => "Survey Added",
            self::TYPE_SURVEY_UPDATED => "Survey Updated",
            self::TYPE_SURVEY_REMOVED => "Survey Removed",
            self::TYPE_SURVEY_REMOVED_MULTI => "Multiple Surveys Removed"
        )
    );

it’s kind of annoying to make another array just to define what is being defined in the keys here, so i was wondering if that was my problem. if it is, i guess i’ll have to make a key-value array for the categories ids and string values.

thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:40:53+00:00Added an answer on May 16, 2026 at 7:40 am

    You’re getting an illegal offset type error because array keys can only be scalar values. From the documentation on arrays:

    A key may be either an integer or a string. If a key is the standard representation of an integer, it will be interpreted as such (i.e. “8” will be interpreted as 8, while “08” will be interpreted as “08”). Floats in key are truncated to integer.

    Since self::CAT_CRON_JOBS et al. seem like they should be constants anyways, why not just define them so that their value is the description text, and then you could just specify your array like

    const CAT_STATEMENT_ADMIN = "Document Administration";
    
    public static $CATS_AND_TYPES = array(
    
      // Statement Administration
      self::CAT_STATEMENT_ADMIN => array(
        self::TYPE_STATEMENTS_LOADED => "Documents Loaded",
        self::TYPE_STATEMENTS_REMOVED => "Documents Removed"
      ),
    
      // etc.
    )
    

    And then you could use either $CATS_AND_TYPES[self::CAT_STATEMENT_ADMIN] (within the class, of course) or $CATS_AND_TYPES['Document Administration'] to get the same array element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.