3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonString = '[{"salesid":130201411173700750}]'; // PHP code $payments = json_decode(stripslashes(html_entity_decode(rtrim($jsonString, '\0'))), true); $values = ''; foreach ($payments as $key => $value) { $value = (object)$value; if ($values != '') { $values .= ','; } printResponse(false, "sales id: $value->salesid"); exit; //more code omitted... } function printResponse($success, $data, $totalCount = 0) { header('Content-Type: application/json;charset=UTF-8'); print json_encode((object)[ 'success' => $success, 'data' => $data, 'totalCount' => $totalCount ]); exit; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 34
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 34
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/8B29e
function name:  (null)
number of ops:  36
compiled vars:  !0 = $jsonString, !1 = $payments, !2 = $values, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B%7B%22salesid%22%3A130201411173700750%7D%5D'
    4     1        INIT_FCALL                                               'json_decode'
          2        INIT_FCALL                                               'stripslashes'
          3        INIT_FCALL                                               'html_entity_decode'
          4        INIT_FCALL                                               'rtrim'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '%5C0'
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !1, $9
    5    16        ASSIGN                                                   !2, ''
    6    17      > FE_RESET_R                                       $12     !1, ->34
         18    > > FE_FETCH_R                                       ~13     $12, !3, ->34
         19    >   ASSIGN                                                   !4, ~13
    7    20        CAST                                          8  ~15     !3
         21        ASSIGN                                                   !3, ~15
    8    22        IS_NOT_EQUAL                                             !2, ''
         23      > JMPZ                                                     ~17, ->25
    9    24    >   ASSIGN_OP                                     8          !2, '%2C'
   11    25    >   INIT_FCALL_BY_NAME                                       'printResponse'
         26        SEND_VAL_EX                                              <false>
         27        NOP                                                      
         28        FETCH_OBJ_R                                      ~19     !3, 'salesid'
         29        FAST_CONCAT                                      ~20     'sales+id%3A+', ~19
         30        SEND_VAL_EX                                              ~20
         31        DO_FCALL                                      0          
   12    32      > EXIT                                                     
    6    33*       JMP                                                      ->18
         34    >   FE_FREE                                                  $12
   24    35      > RETURN                                                   1

Function printresponse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/8B29e
function name:  printResponse
number of ops:  16
compiled vars:  !0 = $success, !1 = $data, !2 = $totalCount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      0
   17     3        INIT_FCALL                                               'header'
          4        SEND_VAL                                                 'Content-Type%3A+application%2Fjson%3Bcharset%3DUTF-8'
          5        DO_ICALL                                                 
   18     6        INIT_FCALL                                               'json_encode'
   19     7        INIT_ARRAY                                       ~4      !0, 'success'
   20     8        ADD_ARRAY_ELEMENT                                ~4      !1, 'data'
   21     9        ADD_ARRAY_ELEMENT                                ~4      !2, 'totalCount'
         10        CAST                                          8  ~5      ~4
         11        SEND_VAL                                                 ~5
   18    12        DO_ICALL                                         $6      
   21    13        ECHO                                                     $6
   23    14      > EXIT                                                     
   24    15*     > RETURN                                                   null

End of function printresponse

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.17 ms | 1008 KiB | 19 Q