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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:16:41+00:00 2026-06-18T02:16:41+00:00

So, In my code one of my variables happened to contain null, which gave

  • 0

So,

In my code one of my variables happened to contain null, which gave me some rather hard to track issues, specifically, it returns something strange.

Below is the print_r of the same array, the first being called as print_r($array['key'][null]) with the null key the second print_r($array['key']) without the null key So what is the first array?

First

Array
(
    [parent_access] => 1
    [seasons] => Array
        (
            [1] => Array
                (
                    [parent_access] => 1
                    [rounds] => Array
                        (
                            [5] => Array
                                (
                                    [direct_access] => 1
                                )

                        )

                )

        )

)

Second (Note, the entire array below can be seen at https://gist.github.com/4679128)

Array
(
    [1] => Array
        (
            [id] => 1
            [type] => competition
            [status] => 0
            [child_access] => 
            [direct_access] => 1
            [parent_access] => 
            [seasons] => Array
                (
                    [1] => Array
                        (
                            [id] => 1
                            [type] => season
                            [status] => 1
                            [child_access] => 1
                            [direct_access] => 
                            [parent_access] => 
                            [rounds] => Array
                                (
                                    [1] => Array
                                        (
                                            [id] => 1
                                            [type] => round
                                            [status] => 1
                                            [child_access] => 1
                                            [direct_access] => 
                                            [parent_access] => 
                                            [games] => Array
                                                (
                                                    [1] => Array
                                                        (
                                                            [id] => 1
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [11] => Array
                                                        (
                                                            [id] => 11
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [21] => Array
                                                        (
                                                            [id] => 21
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [31] => Array
                                                        (
                                                            [id] => 31
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                )

                                        )

                                    [5] => Array
                                        (
                                            [id] => 5
                                            [type] => round
                                            [status] => 1
                                            [child_access] => 1
                                            [direct_access] => 
                                            [parent_access] => 
                                            [games] => Array
                                                (
                                                    [5] => Array
                                                        (
                                                            [id] => 5
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [15] => Array
                                                        (
                                                            [id] => 15
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [25] => Array
                                                        (
                                                            [id] => 25
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [35] => Array
                                                        (
                                                            [id] => 35
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                )

                                        )

                                    [8] => Array
                                        (
                                            [id] => 8
                                            [type] => round
                                            [status] => 1
                                            [child_access] => 1
                                            [direct_access] => 
                                            [parent_access] => 
                                            [games] => Array
                                                (
                                                    [8] => Array
                                                        (
                                                            [id] => 8
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [18] => Array
                                                        (
                                                            [id] => 18
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [28] => Array
                                                        (
                                                            [id] => 28
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [38] => Array
                                                        (
                                                            [id] => 38
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                )

                                        )

                                    [10] => Array
                                        (
                                            [id] => 10
                                            [type] => round
                                            [status] => 1
                                            [child_access] => 1
                                            [direct_access] => 
                                            [parent_access] => 
                                            [games] => Array
                                                (
                                                    [10] => Array
                                                        (
                                                            [id] => 10
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [20] => Array
                                                        (
                                                            [id] => 20
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [30] => Array
                                                        (
                                                            [id] => 30
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [40] => Array
                                                        (
                                                            [id] => 40
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                )

                                        )

                                )

                        )

                    [2] => Array
                        (
                            [id] => 2
                            [type] => season
                            [status] => 1
                            [child_access] => 1
                            [direct_access] => 
                            [parent_access] => 
                            [rounds] => Array
                                (
                                    [2] => Array
                                        (
                                            [id] => 2
                                            [type] => round
                                            [status] => 1
                                            [child_access] => 1
                                            [direct_access] => 
                                            [parent_access] => 
                                            [games] => Array
                                                (
                                                    [2] => Array
                                                        (
                                                            [id] => 2
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [12] => Array
                                                        (
                                                            [id] => 12
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [22] => Array
                                                        (
                                                            [id] => 22
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [32] => Array
                                                        (
                                                            [id] => 32
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                )

                                        )

                                    [6] => Array
                                        (
                                            [id] => 6
                                            [type] => round
                                            [status] => 1
                                            [child_access] => 1
                                            [direct_access] => 
                                            [parent_access] => 
                                            [games] => Array
                                                (
                                                    [6] => Array
                                                        (
                                                            [id] => 6
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [16] => Array
                                                        (
                                                            [id] => 16
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [26] => Array
                                                        (
                                                            [id] => 26
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [36] => Array
                                                        (
                                                            [id] => 36
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                )

                                        )

                                    [9] => Array
                                        (
                                            [id] => 9
                                            [type] => round
                                            [status] => 1
                                            [child_access] => 1
                                            [direct_access] => 
                                            [parent_access] => 
                                            [games] => Array
                                                (
                                                    [9] => Array
                                                        (
                                                            [id] => 9
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [19] => Array
                                                        (
                                                            [id] => 19
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [29] => Array
                                                        (
                                                            [id] => 29
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                    [39] => Array
                                                        (
                                                            [id] => 39
                                                            [type] => game
                                                            [status] => 1
                                                            [child_access] => 1
                                                            [direct_access] => 
                                                            [parent_access] => 
                                                        )

                                                )

                                        )

                                )

                        )

                )

        )

    [2] => Array
        (
            [id] => 2
            [type] => competition
            [status] => 1
            [child_access] => 
            [direct_access] => 
            [parent_access] => 
            [seasons] => Array
                (
                    [3] => Array
                        (
                            [id] => 3
                            [type] => season
                            [status] => 1
                            [child_access] => 
                            [direct_access] => 
                            [parent_access] => 
                            [rounds] => Array
                                (
  • 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-06-18T02:16:43+00:00Added an answer on June 18, 2026 at 2:16 am

    http://ideone.com/pXRVKE

    So the null is casted to an empty string.

    http://php.net/manual/en/language.types.array.php

    Null will be cast to the empty string, i.e. the key null will actually be stored under “”.

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

Sidebar

Related Questions

The following code sends me an email holding the following variables. One of the
I have the following code in one cpp file which is part of a
I have the following code in one of my Sql (2008) Stored Procs which
I am reviewing some code and one of the code analysis (fxCop) warnings has
In this C code i have tried to assign pointer addresses of one variable
In code one can specify globally accessible constants/enums/etc once that can then be reused
I'm currently attempting to code one for part of a college project - binary/hex
How many max number of lines of code one .cs file should hold. Are
I was looking through someone's code one day and I was annoyed how they
I have this code in one of my controllers to get access to eventful.

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.