3v4l.org

run code in 300+ PHP versions simultaneously
<?php function buildVirtualData($var) { if ( is_string($var) && null !== $json = json_decode($var, true) ) $var = $json; if ( is_array($var) ) return array_map('buildVirtualData', $var); return $var; } $_POST = array( "valor1" => 1200, "valor2" => "texto", "valor3" => true, "valor4" => '{"seclvl_text":"datp","seclvl_boolean":"false", "nestedJSONString":"{\"key\":\"value\"}"}', "valor5" => "true" ); var_dump(buildVirtualData($_POST));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZ0i4
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_W                      global              $0      '_POST'
          1        ASSIGN                                                   $0, <array>
   24     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'buildvirtualdata'
          4        FETCH_R                      global              ~2      '_POST'
          5        SEND_VAL                                                 ~2
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function buildvirtualdata:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 10
filename:       /in/JZ0i4
function name:  buildVirtualData
number of ops:  21
compiled vars:  !0 = $var, !1 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        TYPE_CHECK                                   64  ~2      !0
          2      > JMPZ_EX                                          ~2      ~2, ->10
          3    >   INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $3      
          7        ASSIGN                                           ~4      !1, $3
          8        TYPE_CHECK                                  1020  ~5      ~4
          9        BOOL                                             ~2      ~5
         10    > > JMPZ                                                     ~2, ->12
    6    11    >   ASSIGN                                                   !0, !1
    8    12    >   TYPE_CHECK                                  128          !0
         13      > JMPZ                                                     ~7, ->19
    9    14    >   INIT_FCALL                                               'array_map'
         15        SEND_VAL                                                 'buildVirtualData'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $8      
         18      > RETURN                                                   $8
   11    19    > > RETURN                                                   !0
   12    20*     > RETURN                                                   null

End of function buildvirtualdata

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.31 ms | 1403 KiB | 20 Q