3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = <<<SOURCE { "head": { "comm": 7, "compress": false, "ms": 1451029423348, "encrypt": false, "version": 2 }, "body": { "data1": 0, "data2": 59, "data3": -40, "data4": 0, "data5": 0 } } SOURCE; $string = get_magic_quotes_gpc() ? stripslashes($source) : $source; $object = json_decode($string); var_dump($object);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function get_magic_quotes_gpc() in /in/W2G6i:22 Stack trace: #0 {main} thrown in /in/W2G6i on line 22
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Function get_magic_quotes_gpc() is deprecated in /in/W2G6i on line 22 object(stdClass)#2 (2) { ["head"]=> object(stdClass)#1 (5) { ["comm"]=> int(7) ["compress"]=> bool(false) ["ms"]=> int(1451029423348) ["encrypt"]=> bool(false) ["version"]=> int(2) } ["body"]=> object(stdClass)#3 (5) { ["data1"]=> int(0) ["data2"]=> int(59) ["data3"]=> int(-40) ["data4"]=> int(0) ["data5"]=> int(0) } }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
object(stdClass)#2 (2) { ["head"]=> object(stdClass)#1 (5) { ["comm"]=> int(7) ["compress"]=> bool(false) ["ms"]=> int(1451029423348) ["encrypt"]=> bool(false) ["version"]=> int(2) } ["body"]=> object(stdClass)#3 (5) { ["data1"]=> int(0) ["data2"]=> int(59) ["data3"]=> int(-40) ["data4"]=> int(0) ["data5"]=> int(0) } }
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
object(stdClass)#1 (2) { ["head"]=> object(stdClass)#2 (5) { ["comm"]=> int(7) ["compress"]=> bool(false) ["ms"]=> int(1451029423348) ["encrypt"]=> bool(false) ["version"]=> int(2) } ["body"]=> object(stdClass)#3 (5) { ["data1"]=> int(0) ["data2"]=> int(59) ["data3"]=> int(-40) ["data4"]=> int(0) ["data5"]=> int(0) } }

preferences:
184.67 ms | 402 KiB | 224 Q