String Viewers
A string in your output is often more than text: an API's JSON, a long log message, a base64 image, or a fragment of HTML. Runlet recognises these and offers a view that fits, next to the usual Tree:
php
App\Models\Order::find(1042)->toJson();The result is a JSON string, so its card gets a JSON tab with an expandable tree.
String viewers work in result and dump cards, and in the run inspector's values. Plain and Raw output show strings as text, as before.
The Viewers
| View | For | What you get |
|---|---|---|
| JSON | A string that holds a JSON document | An expandable tree and Copy Pretty. Numbers keep their exact digits, including large integers and precise decimals, and members keep their order. |
| Text | Long strings, of 1,000 bytes or 10 lines or more (they open here by default) | Selectable, scrollable text that wraps, with search: match counts and previous and next. Any string can switch to Text. |
| Image | PNG, JPEG, and SVG images, as base64, as data: URLs, or as binary strings, and raw SVG | The image, at most 1,024 pixels for raster images. |
| Preview | A string that starts with common HTML tags | The rendered HTML, with its Source and Copy HTML. |
Choose a view with the picker at the top of the card. Switching views never runs PHP, connects to the target, or changes anything about the next run.
Safe by Default
- Previews are locked down. HTML and SVG have scripts turned off and remote content blocked. Remote images in an HTML preview load only when you choose Load Remote Images for that preview.
- Nothing is fetched. Runlet only looks at the string it already has: no files or URLs are opened.
- Large values stay text. A JSON document deeper than 32 levels or with more than about 2,048 values stays in Tree and Text, and a JSON tree shows at most 200 children per object or array, marking the rest. Images larger than 4,096 pixels on a side, or that aren't valid, aren't shown.
- Cut strings. A string the runner had to shorten, or one larger than 64 KiB, offers Text only: no JSON, image, or detected HTML. Text shows how much was cut.



