3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json='{"description":"Testing","site":"http:\\/\\/localhost","steps":{"step":{"command":"grabimage","parameter":"img[alt=\\"1Next\\"]"}}}'; /*$array=array ( 'description' => 'Testing', 'site' => 'http://localhost', 'steps' => array ( 'step' => array ( 'command' => 'grabimage', 'parameter' => 'img[alt="1Next"]', ) ), );*/ //var_export(json_encode($array)); $array=json_decode($json,true); if(key($array['steps']['step'])==='command'){ $array['steps']['step']=[$array['steps']['step']]; } var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/UA2Sl
function name:  (null)
number of ops:  23
compiled vars:  !0 = $json, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22description%22%3A%22Testing%22%2C%22site%22%3A%22http%3A%5C%2F%5C%2Flocalhost%22%2C%22steps%22%3A%7B%22step%22%3A%7B%22command%22%3A%22grabimage%22%2C%22parameter%22%3A%22img%5Balt%3D%5C%221Next%5C%22%5D%22%7D%7D%7D'
   18     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   19     6        INIT_FCALL                                               'key'
          7        FETCH_DIM_R                                      ~5      !1, 'steps'
          8        FETCH_DIM_R                                      ~6      ~5, 'step'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        IS_IDENTICAL                                             $7, 'command'
         12      > JMPZ                                                     ~8, ->19
   20    13    >   FETCH_DIM_R                                      ~11     !1, 'steps'
         14        FETCH_DIM_R                                      ~12     ~11, 'step'
         15        INIT_ARRAY                                       ~13     ~12
         16        FETCH_DIM_W                                      $9      !1, 'steps'
         17        ASSIGN_DIM                                               $9, 'step'
         18        OP_DATA                                                  ~13
   22    19    >   INIT_FCALL                                               'var_export'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.02 ms | 1002 KiB | 16 Q