3v4l.org

run code in 300+ PHP versions simultaneously
<?php $option = 'test'; $legend = json_decode('[{"id":"Horario","text":"Horario","answer":null},{"id":"Name","text":"Nome","answer":"ABILIO BRANDAO DE MELO"},{"id":"Phone","text":"Telefone","answer":"917778621"},{"id":"Email","text":"Email","answer":"melo22_fca@hotmail.com"},{"id":"Insc1","text":"Insc1","answer":"albano"},{"id":"Insc2","text":"Insc2","answer":"jorge"},{"id":"Insc3","text":"Insc3","answer":""}]'); foreach($legend as $obj){ if($obj->id == 'Horario') $obj->answer=$option; } var_dump($legend);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/WmeMf
function name:  (null)
number of ops:  18
compiled vars:  !0 = $option, !1 = $legend, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'test'
    3     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAL                                                 '%5B%7B%22id%22%3A%22Horario%22%2C%22text%22%3A%22Horario%22%2C%22answer%22%3Anull%7D%2C%7B%22id%22%3A%22Name%22%2C%22text%22%3A%22Nome%22%2C%22answer%22%3A%22ABILIO+BRANDAO+DE+MELO%22%7D%2C%7B%22id%22%3A%22Phone%22%2C%22text%22%3A%22Telefone%22%2C%22answer%22%3A%22917778621%22%7D%2C%7B%22id%22%3A%22Email%22%2C%22text%22%3A%22Email%22%2C%22answer%22%3A%22melo22_fca%40hotmail.com%22%7D%2C%7B%22id%22%3A%22Insc1%22%2C%22text%22%3A%22Insc1%22%2C%22answer%22%3A%22albano%22%7D%2C%7B%22id%22%3A%22Insc2%22%2C%22text%22%3A%22Insc2%22%2C%22answer%22%3A%22jorge%22%7D%2C%7B%22id%22%3A%22Insc3%22%2C%22text%22%3A%22Insc3%22%2C%22answer%22%3A%22%22%7D%5D'
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    5     5      > FE_RESET_R                                       $6      !1, ->13
          6    > > FE_FETCH_R                                               $6, !2, ->13
    6     7    >   FETCH_OBJ_R                                      ~7      !2, 'id'
          8        IS_EQUAL                                                 ~7, 'Horario'
          9      > JMPZ                                                     ~8, ->12
    7    10    >   ASSIGN_OBJ                                               !2, 'answer'
         11        OP_DATA                                                  !0
    5    12    > > JMP                                                      ->6
         13    >   FE_FREE                                                  $6
   10    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.01 ms | 999 KiB | 15 Q