3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json1 = '{"data": [{"category": "Games","id": "45345"}, {"category": "Music","id": "345345345"}, {"category": "Food","id": "1"}, {"category": "Pets","id": "13245345"}],"paging": {"next": "https://graph.facebook.com/1161990140/likes?limit=2&offset=2&__after_id=118243704898877"}}'; $json2 = '{"data": {"something": "blah","posts": [{"id": "34241","title": "orange"}],"items": [{"id": "1","name": "orange"},{"id": "2","name": "dog"},{"id": "3","name": "cat"},{"id": "4","name": "apple"}]}}'; $array1 = json_decode($json1, true); $array2 = json_decode($json2, true); $result = array_diff($array1, $array2); var_dump($result);
Output for 7.0.0 - 7.2.6
Notice: Array to string conversion in /in/hn7XZ on line 8 Notice: Array to string conversion in /in/hn7XZ on line 8 Notice: Array to string conversion in /in/hn7XZ on line 8 array(0) { }
Output for 5.4.0 - 5.6.28
Notice: Array to string conversion in /in/hn7XZ on line 8 Notice: Array to string conversion in /in/hn7XZ on line 8 Notice: Array to string conversion in /in/hn7XZ on line 8 Notice: Array to string conversion in /in/hn7XZ on line 8 Notice: Array to string conversion in /in/hn7XZ on line 8 Notice: Array to string conversion in /in/hn7XZ on line 8 array(0) { }
Output for 5.2.0 - 5.3.29
array(0) { }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/hn7XZ on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/hn7XZ on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/hn7XZ on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/hn7XZ on line 5