3v4l.org

run code in 300+ PHP versions simultaneously
<?php $blocks = [ 'header' => ['html' => '<header>%s</header>'], 'body' => ['html' => '<div>%s</div>'], 'footer' => ['html' => '<footer>%s</footer>'] ]; $elems = [ ]; $json = json_decode('{"header":[{"type":"background","data":{"src":"https://s3-eu-west-1.amazonaws.com/ptfl/panorama/517e910005dd01e736000005.jpg"}},{"type":"title","data":[{"type":"link","data":{"text":"WeDo","href":"http://dev.dotoknow.com/project/view/517e8bcd05dd018f3b00000e"}}]}],"body":[{"type":"post","data":{"text":["DoToKnow is a project like any other. And alike many other projects it is an ongoing process of discussing, building, developing and fine-tuning. On this page we will keep you up to date on any news and features of DoToKnow.","We would like to ask you to stay on-topic within the posts. If you have any questions, have a look at our About or FAQ pages. If they don\'t provide you with the necessary information you can always contact us through feedback@dotoknow.com"],"project":"517e8bcd05dd018f3b00000e","post":0}}],"footer":[{"type":"tags","data":{"text":["DoToKnow","Official Project","News Channel","Developer blog"]}}]}'); $html = ''; foreach($json as $key => $block) { $html .= $blocks[$key]->html; } print $html;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/cokuT
function name:  (null)
number of ops:  17
compiled vars:  !0 = $blocks, !1 = $elems, !2 = $json, !3 = $html, !4 = $block, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAL                                                 '%7B%22header%22%3A%5B%7B%22type%22%3A%22background%22%2C%22data%22%3A%7B%22src%22%3A%22https%3A%2F%2Fs3-eu-west-1.amazonaws.com%2Fptfl%2Fpanorama%2F517e910005dd01e736000005.jpg%22%7D%7D%2C%7B%22type%22%3A%22title%22%2C%22data%22%3A%5B%7B%22type%22%3A%22link%22%2C%22data%22%3A%7B%22text%22%3A%22WeDo%22%2C%22href%22%3A%22http%3A%2F%2Fdev.dotoknow.com%2Fproject%2Fview%2F517e8bcd05dd018f3b00000e%22%7D%7D%5D%7D%5D%2C%22body%22%3A%5B%7B%22type%22%3A%22post%22%2C%22data%22%3A%7B%22text%22%3A%5B%22DoToKnow+is+a+project+like+any+other.+And+alike+many+other+projects+it+is+an+ongoing+process+of+discussing%2C+building%2C+developing+and+fine-tuning.+On+this+page+we+will+keep+you+up+to+date+on+any+news+and+features+of+DoToKnow.%22%2C%22We+would+like+to+ask+you+to+stay+on-topic+within+the+posts.+If+you+have+any+questions%2C+have+a+look+at+our+About+or+FAQ+pages.+If+they+don%27t+provide+you+with+the+necessary+information+you+can+always+contact+us+through+feedback%40dotoknow.com%22%5D%2C%22project%22%3A%22517e8bcd05dd018f3b00000e%22%2C%22post%22%3A0%7D%7D%5D%2C%22footer%22%3A%5B%7B%22type%22%3A%22tags%22%2C%22data%22%3A%7B%22text%22%3A%5B%22DoToKnow%22%2C%22Official+Project%22%2C%22News+Channel%22%2C%22Developer+blog%22%5D%7D%7D%5D%7D'
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !2, $8
   17     6        ASSIGN                                                   !3, ''
   19     7      > FE_RESET_R                                       $11     !2, ->14
          8    > > FE_FETCH_R                                       ~12     $11, !4, ->14
          9    >   ASSIGN                                                   !5, ~12
   21    10        FETCH_DIM_R                                      ~14     !0, !5
         11        FETCH_OBJ_R                                      ~15     ~14, 'html'
         12        ASSIGN_OP                                     8          !3, ~15
   19    13      > JMP                                                      ->8
         14    >   FE_FREE                                                  $11
   24    15        ECHO                                                     !3
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.78 ms | 1396 KiB | 15 Q