3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = <<<END { "swagger": "2.0", "paths": { "/": { "get": { "responses": { "200": { "description": "OK" } } } } }, "definitions": { "Pet": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer", "format": "int64" } } }, "Dog": { "type": "object", "allOf": [ { "$ref": "#/definitions/Pet" }, { "required": [ "name" ], "properties": { "name": { "type": "string" } } } ], "x-vendor-ext": "some data" } } } END; $str = str_replace("\t", " ", $str); $str = str_replace('"', '\"', $str); $lines = explode("\n", $str); foreach($lines as &$l) { $l = '"' . $l; } echo implode('\n" +' . "\n", $lines) . '";';
based on R8Z61
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: ref in /in/IEPWM on line 34 "{\n" + " \"swagger\": \"2.0\",\n" + " \"paths\": {\n" + " \"/\": {\n" + " \"get\": {\n" + " \"responses\": {\n" + " \"200\": {\n" + " \"description\": \"OK\"\n" + " }\n" + " }\n" + " }\n" + " }\n" + " },\n" + " \"definitions\": {\n" + " \"Pet\": {\n" + " \"type\": \"object\",\n" + " \"required\": [\n" + " \"id\"\n" + " ],\n" + " \"properties\": {\n" + " \"id\": {\n" + " \"type\": \"integer\",\n" + " \"format\": \"int64\"\n" + " }\n" + " }\n" + " },\n" + " \"Dog\": {\n" + " \"type\": \"object\",\n" + " \"allOf\": [\n" + " {\n" + " \"\": \"#/definitions/Pet\"\n" + " },\n" + " {\n" + " \"required\": [\n" + " \"name\"\n" + " ],\n" + " \"properties\": {\n" + " \"name\": {\n" + " \"type\": \"string\"\n" + " }\n" + " }\n" + " }\n" + " ],\n" + " \"x-vendor-ext\": \"some data\"\n" + " }\n" + " }\n" + "}";
Output for 5.3.21 - 5.6.28
Notice: Undefined variable: ref in /in/IEPWM on line 50 "{\n" + " \"swagger\": \"2.0\",\n" + " \"paths\": {\n" + " \"/\": {\n" + " \"get\": {\n" + " \"responses\": {\n" + " \"200\": {\n" + " \"description\": \"OK\"\n" + " }\n" + " }\n" + " }\n" + " }\n" + " },\n" + " \"definitions\": {\n" + " \"Pet\": {\n" + " \"type\": \"object\",\n" + " \"required\": [\n" + " \"id\"\n" + " ],\n" + " \"properties\": {\n" + " \"id\": {\n" + " \"type\": \"integer\",\n" + " \"format\": \"int64\"\n" + " }\n" + " }\n" + " },\n" + " \"Dog\": {\n" + " \"type\": \"object\",\n" + " \"allOf\": [\n" + " {\n" + " \"\": \"#/definitions/Pet\"\n" + " },\n" + " {\n" + " \"required\": [\n" + " \"name\"\n" + " ],\n" + " \"properties\": {\n" + " \"name\": {\n" + " \"type\": \"string\"\n" + " }\n" + " }\n" + " }\n" + " ],\n" + " \"x-vendor-ext\": \"some data\"\n" + " }\n" + " }\n" + "}";