ini_get_all

ini_get_all(?string $extension = null, bool $details = true): array|false

Fetches all (or one extension's) runtime config directives at once; each item carries global value, local value and modification access.

C C23

C23
#include <stdio.h>
#include <string.h>

/* C has no global config registry: a full POSIX environ enumeration is the closest counterpart */
extern char **environ;

int main(void) {
    int count = 0, has_path = 0;
    for (char **e = environ; *e != NULL; e++) {
        count++;
        if (strncmp(*e, "PATH=", 5) == 0) has_path = 1;
    }
    printf("non-empty: %d\n", count > 0);
    printf("path present: %d\n", has_path);
    return 0;
}
Output
non-empty: 1
path present: 1

C++ C++26

C++26
#include <cstring>
#include <iostream>

// C++ same as C: a full POSIX environ enumeration is the closest counterpart
extern char **environ;

int main() {
    int count = 0;
    bool has_path = false;
    for (char **e = environ; *e != nullptr; e++) {
        count++;
        if (std::strncmp(*e, "PATH=", 5) == 0) has_path = true;
    }
    std::cout << std::boolalpha;
    std::cout << "non-empty: " << (count > 0) << "\n";
    std::cout << "path present: " << has_path << "\n";
    return 0;
}
Output
non-empty: true
path present: true

C# v11.0.100

v11.0.100
// Counterpart: Environment.GetEnvironmentVariables() enumerates all environment variables (case-insensitive key comparison)
var env = Environment.GetEnvironmentVariables();
var keys = new HashSet<string>(env.Keys.Cast<string>(), StringComparer.OrdinalIgnoreCase);
Console.WriteLine($"non-empty: {env.Count > 0}");
Console.WriteLine($"path present: {keys.Contains("PATH")}");
Output
non-empty: True
path present: True

Go v1.27.4

v1.27.4
package main

import (
	"fmt"
	"os"
	"strings"
)

func main() {
	// Counterpart: Go has no global config registry — the full read is an os.Environ() enumeration
	env := os.Environ()
	fmt.Println("non-empty:", len(env) > 0)
	found := false
	for _, kv := range env {
		if strings.HasPrefix(kv, "PATH=") {
			found = true
		}
	}
	fmt.Println("path present:", found)
}
Output
non-empty: true
path present: true

Java v27.0.1

v27.0.1
import java.util.Properties;

public class Main {
    public static void main(String[] args) {
        // Counterpart: System.getProperties() is the closest full config table to ini_get_all
        Properties props = System.getProperties();
        System.out.println("non-empty: " + !props.isEmpty());
        System.out.println("java.version key present: " + props.containsKey("java.version"));
    }
}
Output
non-empty: true
java.version key present: true

JavaScript v26.13.1

v26.13.1
// Counterpart: Node has no global config registry — the full read is a process.env enumeration
const keys = Object.keys(process.env);
console.log("non-empty:", keys.length > 0);
console.log("path present:", "PATH" in process.env || "Path" in process.env);
Output
non-empty: true
path present: true

PHP v8.6.0

v8.6.0
// ini_get_all: fetch every config directive at once (filterable by extension); the total drifts across versions — print only stable derived facts
$all = ini_get_all();
echo "non-empty: ", $all !== [] ? "yes" : "no", "\n";
var_dump(array_key_exists("display_errors", $all));
// Every directive carries at least global_value/local_value (the key count evolves across versions — PHP 8.5 added builtin_default_value)
var_dump(array_key_exists("global_value", $all["display_errors"]));
var_dump(array_key_exists("local_value", $all["display_errors"]));
Output
non-empty: yes
bool(true)
bool(true)
bool(true)

Python v3.15.2

v3.15.2
import os

# Counterpart: Python has no php.ini-style global config — the closest full read is os.environ (process environment variables)
print("non-empty:", len(os.environ) > 0)
print("path present:", "PATH" in os.environ)
Output
non-empty: True
path present: True

Rust v1.99.1

v1.99.1
use std::env;

fn main() {
    // Counterpart: Rust has no global config registry — the full read is an env::vars() enumeration
    let vars: Vec<(String, String)> = env::vars().collect();
    println!("non-empty: {}", !vars.is_empty());
    println!(
        "path present: {}",
        vars.iter().any(|(k, _)| k.eq_ignore_ascii_case("PATH"))
    );
}
Output
non-empty: true
path present: true

TypeScript v26.13.1

v26.13.1
// Counterpart: Node has no global config registry — the full read is a process.env enumeration
const keys: string[] = Object.keys(process.env);
console.log("non-empty:", keys.length > 0);
console.log("path present:", "PATH" in process.env || "Path" in process.env);
Output
non-empty: true
path present: true

Language differences

C: no global config registry — the POSIX environ enumeration is the closest cousin; values are all strings.

C++: same as C (environ); real configs get parsed with toml++/inih.

C#: Environment.GetEnvironmentVariables() enumerates env vars (an IDictionary); the real config story is the IConfiguration extension package.

Go: os.Environ() enumerates everything; no INI parser in the standard library.

Java: System.getProperties() is the closest thing to ini_get_all — stringPropertyNames() enumerates it, and Properties.load/store is semantically the nearest to INI.

JavaScript: process.env enumerates env vars (values all strings); Node has no built-in INI parser.

PHP: ini_get_all() fetches every directive — filterable by $extension; each item carries at least global_value/local_value (8.x adds access, 8.5+ adds builtin_default_value — the shape evolves, never assert the structure); the total drifts with version/extension count, so never assert on the array size.

Python: os.environ enumerates env vars; configparser reads INI files (sections()/items() to enumerate).

Rust: env::vars() enumerates (allocates a Vec); no built-in INI parsing — the config crate is the norm.

TypeScript: same as JavaScript (process.env plus hand parsing or dotenv).