3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attributes = ['Type' => 'MyType']; $payload = "Frankfurt"; $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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OsbFo
function name:  (null)
number of ops:  31
compiled vars:  !0 = $attributes, !1 = $payload, !2 = $jobMessage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'Frankfurt'
    5     2        INIT_FCALL                                               'json_encode'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $5      
          5        INIT_ARRAY                                       ~6      $5, 'MessageBody'
    7     6        INIT_FCALL                                               'array_merge'
    9     7        SEND_VAL                                                 <array>
   13     8        INIT_FCALL                                               'array_values'
          9        INIT_FCALL                                               'array_map'
   14    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOsbFo%3A14%240'
   21    11        SEND_VAL                                                 ~7
   22    12        INIT_FCALL                                               'array_keys'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $8      
         15        SEND_VAR                                                 $8
   23    16        INIT_FCALL                                               'array_values'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                         $10     
         21        SEND_VAR                                                 $10
         22        DO_ICALL                                         $11     
         23        SEND_VAR                                                 $11
         24        DO_ICALL                                         $12     
         25        ADD_ARRAY_ELEMENT                                ~6      $12, 'MessageAttributes'
    4    26        ASSIGN                                                   !2, ~6
   27    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOsbFo%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OsbFo
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        CAST                                          6  ~2      !0
   17     3        INIT_ARRAY                                       ~3      'String', 'DataType'
   18     4        ADD_ARRAY_ELEMENT                                ~3      !1, 'StringValue'
          5        INIT_ARRAY                                       ~4      ~3, ~2
          6      > RETURN                                                   ~4
   21     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOsbFo%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.26 ms | 1400 KiB | 25 Q