3v4l.org

run code in 300+ PHP versions simultaneously
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.32, 8.2.0 - 8.2.28, 8.3.0 - 8.3.4, 8.3.6 - 8.3.19, 8.4.1 - 8.4.6
{ "nodes": [ { "id": "0", "type": "food" }, { "id": "1", "type": "drinks" }, { "id": "2", "type": "snacks" }, { "id": "3", "type": "food" }, { "id": "4", "type": "drinks" } ], "links": [ { "source": "0", "target": "1" }, { "source": "1", "target": "2" }, { "source": "2", "target": "0" } ] } { "nodes": { "0": { "id": "0", "type": "food" }, "1": { "id": "1", "type": "drinks" }, "2": { "id": "2", "type": "snacks" }, "4": { "id": "4", "type": "drinks" } }, "links": [ { "source": "0", "target": "1" }, { "source": "1", "target": "2" }, { "source": "2", "target": "0" } ] } Fatal error: Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array, stdClass given in /in/XPbuo:30 Stack trace: #0 /in/XPbuo(30): array_values(Object(stdClass)) #1 {main} thrown in /in/XPbuo on line 30
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 { "nodes": [ { "id": "0", "type": "food" }, { "id": "1", "type": "drinks" }, { "id": "2", "type": "snacks" }, { "id": "3", "type": "food" }, { "id": "4", "type": "drinks" } ], "links": [ { "source": "0", "target": "1" }, { "source": "1", "target": "2" }, { "source": "2", "target": "0" } ] } { "nodes": { "0": { "id": "0", "type": "food" }, "1": { "id": "1", "type": "drinks" }, "2": { "id": "2", "type": "snacks" }, "4": { "id": "4", "type": "drinks" } }, "links": [ { "source": "0", "target": "1" }, { "source": "1", "target": "2" }, { "source": "2", "target": "0" } ] } Fatal error: Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array, stdClass given in /in/XPbuo:30 Stack trace: #0 /in/XPbuo(30): array_values(Object(stdClass)) #1 {main} thrown in /in/XPbuo on line 30
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
{ "nodes": [ { "id": "0", "type": "food" }, { "id": "1", "type": "drinks" }, { "id": "2", "type": "snacks" }, { "id": "3", "type": "food" }, { "id": "4", "type": "drinks" } ], "links": [ { "source": "0", "target": "1" }, { "source": "1", "target": "2" }, { "source": "2", "target": "0" } ] } { "nodes": { "0": { "id": "0", "type": "food" }, "1": { "id": "1", "type": "drinks" }, "2": { "id": "2", "type": "snacks" }, "4": { "id": "4", "type": "drinks" } }, "links": [ { "source": "0", "target": "1" }, { "source": "1", "target": "2" }, { "source": "2", "target": "0" } ] } Warning: array_values() expects parameter 1 to be array, object given in /in/XPbuo on line 30 null

preferences:
166.92 ms | 420 KiB | 5 Q