3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA [ { "name": "counting animals", "template": "counting", "data": "Images/5cats.jpg", "choices": [ 2, 5, 6, 8 ], "correctAnswer": 1 } ] DATA; $json_var = json_decode($data, true); foreach ($json_var as $value) { if ($value["name"] === "counting animals") { printf('<img src="' . $value["data"] . '" />'); printf("<form id=\"form1\">"); foreach ($value["choices"] as $val) { printf("<input name=\"image-pick\" value=$val type=\"radio\" id=\"one-$val\" >" ); printf("<label></label>"); } printf("</form>"); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 40
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 40
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 39
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 35
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 35
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 35
Branch analysis from position: 39
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/2cCUf
function name:  (null)
number of ops:  42
compiled vars:  !0 = $data, !1 = $json_var, !2 = $value, !3 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%0A++%7B%0A++++%22name%22%3A+%22counting+animals%22%2C%0A++++%22template%22%3A+%22counting%22%2C%0A++++%22data%22%3A+%22Images%2F5cats.jpg%22%2C%0A++++%22choices%22%3A+%5B%0A++++++2%2C%0A++++++5%2C%0A++++++6%2C%0A++++++8%0A++++%5D%2C%0A++++%22correctAnswer%22%3A+1%0A++%7D%0A%5D'
   20     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   22     6      > FE_RESET_R                                       $7      !1, ->40
          7    > > FE_FETCH_R                                               $7, !2, ->40
   23     8    >   FETCH_DIM_R                                      ~8      !2, 'name'
          9        IS_IDENTICAL                                             ~8, 'counting+animals'
         10      > JMPZ                                                     ~9, ->39
   24    11    >   INIT_FCALL                                               'printf'
         12        FETCH_DIM_R                                      ~10     !2, 'data'
         13        CONCAT                                           ~11     '%3Cimg+src%3D%22', ~10
         14        CONCAT                                           ~12     ~11, '%22+%2F%3E'
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
   25    17        INIT_FCALL                                               'printf'
         18        SEND_VAL                                                 '%3Cform+id%3D%22form1%22%3E'
         19        DO_ICALL                                                 
   26    20        FETCH_DIM_R                                      ~15     !2, 'choices'
         21      > FE_RESET_R                                       $16     ~15, ->35
         22    > > FE_FETCH_R                                               $16, !3, ->35
   27    23    >   INIT_FCALL                                               'printf'
         24        ROPE_INIT                                     5  ~18     '%3Cinput+name%3D%22image-pick%22+value%3D'
         25        ROPE_ADD                                      1  ~18     ~18, !3
         26        ROPE_ADD                                      2  ~18     ~18, '+type%3D%22radio%22+id%3D%22one-'
         27        ROPE_ADD                                      3  ~18     ~18, !3
         28        ROPE_END                                      4  ~17     ~18, '%22+%3E'
         29        SEND_VAL                                                 ~17
         30        DO_ICALL                                                 
   28    31        INIT_FCALL                                               'printf'
         32        SEND_VAL                                                 '%3Clabel%3E%3C%2Flabel%3E'
         33        DO_ICALL                                                 
   26    34      > JMP                                                      ->22
         35    >   FE_FREE                                                  $16
   30    36        INIT_FCALL                                               'printf'
         37        SEND_VAL                                                 '%3C%2Fform%3E'
         38        DO_ICALL                                                 
   22    39    > > JMP                                                      ->7
         40    >   FE_FREE                                                  $7
   32    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.76 ms | 1011 KiB | 15 Q