<?php class A implements JsonSerializable { public function jsonSerialize() { return 'A'; } } $b = []; $b[] = new A(); $b[] = new A(); var_dump(json_encode($b));
You have javascript disabled. You will not be able to edit any code.