--TEST-- Context: set/get/has and magic property access for plugin data storage --FILE-- requestPath . "\n"; echo $ctx->contentDir . "\n"; echo ($ctx->hasTrailingSlash ? 'true' : 'false') . "\n"; // set/get/has $ctx->set('langPrefix', '/fr'); echo $ctx->get('langPrefix') . "\n"; echo ($ctx->has('langPrefix') ? 'yes' : 'no') . "\n"; echo ($ctx->has('missing') ? 'yes' : 'no') . "\n"; // get with default echo $ctx->get('nope', 'fallback') . "\n"; // Magic __get / __set $ctx->customKey = 'magic-value'; echo $ctx->customKey . "\n"; // Magic __get for undefined key returns null echo ($ctx->undefined ?? 'null') . "\n"; // set and magic access are the same store $ctx->set('shared', 'data'); echo $ctx->shared . "\n"; $ctx->magic2 = 'x'; echo $ctx->get('magic2') . "\n"; ?> --EXPECT-- blog/post /tmp/content true /fr yes no fallback magic-value null data x