neon sandbox

Download a NEON on GitHub

array (5)
name => "Homer" (5) address => array (3)
| street => "742 Evergreen Terrace" (21) | city => "Springfield" (11) | country => "USA" (3)
phones => array (2)
| home => "555-6528" (8) | work => "555-7334" (8)
children => array (3)
| 0 => "Bart" (4) | 1 => "Lisa" (4) | 2 => "Maggie" (6)
entity => Nette\Neon\Entity #d62e
| value => "Column" (6) | attributes => array (1)
| | type => "integer" (7)

Configuration written in PHP?

$config = array(
    'php' => array(
        'date.timezone' => 'Europe/Prague',
        'zlib.output_compression' => true,
    ),
    'database' => array(
        'driver' => 'mysql',
        'username' => 'root',
        'password' => 'beruska92',
    ),
    'users' => array(
        'Dave',
        'Kryten',
        'Rimmer',
    ),
);

Or is it better to use JSON?

{
"php": {
    "date.timezone": "Europe\/Prague",
    "zlib.output_compression": true
},
"database": {
    "driver": "mysql",
    "username": "root",
    "password": "beruska92"
},
"users": [
    "Dave", "Kryten", "Rimmer"
]
}

What if we could omit quotes?

{
php: {
    date.timezone: Europe/Prague,
    zlib.output_compression: true
},
database: {
    driver: mysql,
    username: root,
    password: beruska92
},
users: [
    Dave, Kryten, Rimmer
]
}

How about braces and commas?

php:
    date.timezone: Europe/Prague
    zlib.output_compression: true

database:
    driver: mysql
    username: root
    password: beruska92

users: [
    Dave, Kryten, Rimmer
]

Are bullets more legible?

php:
    date.timezone: Europe/Prague
    zlib.output_compression: true

database:
    driver: mysql
    username: root
    password: beruska92

users:
    - Dave
    - Kryten
    - Rimmer

How about comments?

# my web application config

php:
    date.timezone: Europe/Prague
    zlib.output_compression: yes  # use gzip

database:
    driver: mysql
    username: root
    password: beruska92

users:
    - Dave
    - Kryten
    - Rimmer

You found NEON syntax!

Download a NEON parser for PHP

or install using composer install nette/neon

NEON is very similar to YAML.The main difference is that the NEON supports "entities" (so can be used e.g. to parse phpDoc annotations) and tab characters for indentation. NEON syntax is a little simpler and the parsing is faster.

Check out NEON File Editor for NetBeans