フォーマッター&コード
JSON to PHP Class / DTO
Strict-typed PHP DTO classes from a JSON sample.
編集者注
Understanding · Modern PHP DTOs are surprisingly tight.
この詳細な解説章は現在、英語版のみで提供されています。上の変換ツールはあなたの言語で動作しますが、長文の解説記事はまだ翻訳されていません。
よくある質問
Quick answers.
›Which version of PHP is supported?
The generator targets PHP 8.1 and above, utilising readonly properties, constructor promotion, and strict type hints. You can manually adjust the output for older versions if required.
›How does it handle nested objects?
Nested JSON objects are automatically identified and generated as separate, linked PHP classes. This maintains a clean, modular structure where each object has its own typed definition.
›Does it support arrays of objects?
Yes. If an array of objects is detected, the tool generates a single class definition for those items and uses array type hinting in the parent class documentation.
›Is my JSON data secure?
Yes. The parsing and transformation happen locally within your browser's memory using JavaScript. Your JSON input and the resulting PHP code are never transmitted to a server.
他の人はこちらも検索しています
関連ツール
More in this room.
- JSON to TypeScript InterfaceJSONサンプルから型を推測し、TSインターフェースを出力します。
- JSON to C# ClassJSONサンプルからPOCOクラスを生成します。
- JSON to Java POJOJSONサンプルからJava POJOを出力します。
- JSON to Python DataclassJSONから型ヒント付きのdataclass(オプションでPydantic)を生成します。
- JSON to Go Structjson:`タグ`付きのGoらしいstructを生成します。
- JSON to Kotlin Data Class任意のJSONサンプルに対応する簡潔なデータクラスを生成します。