3v4l.org

run code in 300+ PHP versions simultaneously
<?php $family_ids = array(1,2,3,4,5,6); $data = []; foreach ($family_ids as $fam_member){ $data[]= ["type"=>"Person","id"=> $fam_member]; } $household = '{ "data": { "attributes": { "name":"xxxxxx" }, "relationships": { "people":{ "data":'. json_encode($data) . ' }, "primary_contact":{ "data":{"type":"Person","id":"1"} } } } }'; echo($household);
Output for git.master, git.master_jit, rfc.property-hooks
{ "data": { "attributes": { "name":"xxxxxx" }, "relationships": { "people":{ "data":[{"type":"Person","id":1},{"type":"Person","id":2},{"type":"Person","id":3},{"type":"Person","id":4},{"type":"Person","id":5},{"type":"Person","id":6}] }, "primary_contact":{ "data":{"type":"Person","id":"1"} } } } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
127.99 ms | 407 KiB | 5 Q