<?php
require_once __DIR__ . '/_util.php';

$path = data_path('world.json');
echo "data_path('world.json') = " . $path . "\n";
echo "exists: " . (file_exists($path) ? "yes" : "no") . "\n";
echo "readable: " . (is_readable($path) ? "yes" : "no") . "\n";

$raw = @file_get_contents($path);
echo "bytes: " . ($raw === false ? "false" : strlen($raw)) . "\n";

$data = @json_decode($raw ?: '', true);
echo "json error: " . json_last_error_msg() . "\n";