#!/usr/bin/env php
<?php

if (file_exists(__DIR__."/../vendor/autoload.php"))
    require_once __DIR__."/../vendor/autoload.php";
else
    require_once __DIR__."/../../../autoload.php";

use NoccyLabs\Pson\Pson;

if ($argc > 1) {
    $json = $argv[1];
} else {
    $json = stream_get_contents(STDIN);
}
$data = json_decode($json, true);
echo Pson::encode($data);