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 7519805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:57:47+00:00 2026-05-30T01:57:47+00:00

Q: Does a colon : in an array key have any special significance? From

  • 0

Q: Does a colon : in an array key have any special significance?

From the manual:

An array can be created by the array() language construct. It takes as parameters any number of comma-separated key => value pairs.

array(  key =>  value
     , ...
     )

While I was investigating what the Exception Object is set to, I created an error condition and put this line in-

print_r($ex);

Then in the web page produced looked at the source and it produces output like this-

Exception Object

(

[message:protected] => DB connection error: SQLSTATE[28000] [1045] Access denied for user 'test'@'localhost' (using password: YES)

[string:Exception:private] => 

Is the colon : in [message:protected] significant or is the key to the key => value pair literally message:protected ?

  • 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-30T01:57:48+00:00Added an answer on May 30, 2026 at 1:57 am

    What you have there is print_rs representation of the exception object’s properties. These aren’t accessible with array notation unless the class implements ArrayAccess and the property is public.

    As a further note, if you had an array like this…

    $array = array(
        'my:key' => 'my:value'
    );
    

    … you can access the value as you normally would with $array['my:key']

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

Sidebar

Related Questions

Does anybody have any experience with the Raphael.js SVG library? I'm using Raphael.js to
I have the following code which does nothing but reading some values from a
how can i have jquery switch between the array below on an elements font
How would I remove any object from my array notafications where I.active = false
Does R have color palettes? In other words, I am looking for an array
I have in a Excel field (created by someone) a formula containing an Array:
What does the colon mean in the following Perl program? MAIN: { print Hello\n;
what does the colon mean in php in the following example. ::1 if($host ==
Does anyone know which property sets the text color for disabled control? I have
Does anyone know if I can find an emacs color syntax configuration which resembles

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.