3v4l.org

run code in 300+ PHP versions simultaneously
<?php $an_object = new StdClass(); $an_object->attr = 'value'; $encoded = json_encode($an_object); print_r( json_decode($encoded, null, 512, JSON_OBJECT_AS_ARRAY)); print_r( json_decode($encoded, true, 512, JSON_OBJECT_AS_ARRAY)); print_r( json_decode($encoded, false, 512, JSON_OBJECT_AS_ARRAY));

preferences:
50.25 ms | 406 KiB | 5 Q