3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attributes = ['Type' => 'MyType']; $payload = "Frankfurt"; var_dump(['one'=>'two']+['one'=>'three']); $jobMessage = [ 'MessageBody' => json_encode($payload), 'MessageAttributes' => array_merge([ "Type" => [ 'StringValue' => __CLASS__, 'DataType' => 'String' ] ], array_values(array_map( function($name, $value) { return [ "$name" => [ 'DataType' => 'String', 'StringValue' => $value, ] ]; }, array_keys($attributes), array_values($attributes) )) ) ]; var_dump($jobMessage);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["one"]=> string(3) "two" } array(2) { ["MessageBody"]=> string(11) ""Frankfurt"" ["MessageAttributes"]=> array(2) { ["Type"]=> array(2) { ["StringValue"]=> string(0) "" ["DataType"]=> string(6) "String" } [0]=> array(1) { ["Type"]=> array(2) { ["DataType"]=> string(6) "String" ["StringValue"]=> string(6) "MyType" } } } }

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:
54.87 ms | 402 KiB | 8 Q