3v4l.org

run code in 300+ PHP versions simultaneously
<?php function DDBwrite($table, $items) { global $aws, $DDB; if (!isset($DDB)) $DDB = $aws->get('dynamodb'); foreach ($items as $key => $value) { if( $value==null || $value=="") { unset ($items[$key]); continue; } $type="N"; if(is_string($value)) $type="S"; $items[$key] = array($type=>$value); } return $DDB->putItem(array( "TableName" => $table, "Item" => $items))->toArray(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CQhOl
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   1

Function ddbwrite:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 29
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 29
Branch analysis from position: 13
2 jumps found. (Code = 47) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 25
Branch analysis from position: 18
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 11
filename:       /in/CQhOl
function name:  DDBwrite
number of ops:  39
compiled vars:  !0 = $table, !1 = $items, !2 = $aws, !3 = $DDB, !4 = $value, !5 = $key, !6 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        BIND_GLOBAL                                              !2, 'aws'
          3        BIND_GLOBAL                                              !3, 'DDB'
    5     4        ISSET_ISEMPTY_CV                                 ~7      !3
          5        BOOL_NOT                                         ~8      ~7
          6      > JMPZ                                                     ~8, ->11
    6     7    >   INIT_METHOD_CALL                                         !2, 'get'
          8        SEND_VAL_EX                                              'dynamodb'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !3, $9
    8    11    > > FE_RESET_R                                       $11     !1, ->29
         12    > > FE_FETCH_R                                       ~12     $11, !4, ->29
         13    >   ASSIGN                                                   !5, ~12
    9    14        IS_EQUAL                                         ~14     !4, null
         15      > JMPNZ_EX                                         ~14     ~14, ->18
         16    >   IS_EQUAL                                         ~15     !4, ''
         17        BOOL                                             ~14     ~15
         18    > > JMPZ                                                     ~14, ->21
         19    >   UNSET_DIM                                                !1, !5
         20      > JMP                                                      ->12
   10    21    >   ASSIGN                                                   !6, 'N'
         22        TYPE_CHECK                                   64          !4
         23      > JMPZ                                                     ~17, ->25
         24    >   ASSIGN                                                   !6, 'S'
   11    25    >   INIT_ARRAY                                       ~20     !4, !6
         26        ASSIGN_DIM                                               !1, !5
         27        OP_DATA                                                  ~20
    8    28      > JMP                                                      ->12
         29    >   FE_FREE                                                  $11
   14    30        INIT_METHOD_CALL                                         !3, 'putItem'
   15    31        INIT_ARRAY                                       ~21     !0, 'TableName'
   16    32        ADD_ARRAY_ELEMENT                                ~21     !1, 'Item'
         33        SEND_VAL_EX                                              ~21
         34        DO_FCALL                                      0  $22     
         35        INIT_METHOD_CALL                                         $22, 'toArray'
         36        DO_FCALL                                      0  $23     
         37      > RETURN                                                   $23
   18    38*     > RETURN                                                   null

End of function ddbwrite

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.35 ms | 1399 KiB | 13 Q