3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "@context" => "http://schema.org", "@type" => "BreadcrumbList", "itemListElement" => array([ "@type" => "ListItem", "position" => 1, "item" =>[ "@id" => "www.example.com/", "name" => "Home" ] //I need $lab[] to show here ]) ); $i = 1; foreach ($pages as $page) { $i++; $arr['itemListElement'][] = [ '@type' => 'ListItem', 'position' => $i, 'item' => [ "@id" => $page->getUri(), "name" =>$page->getLabel() ]]; } var_dump($arr,$lab); json_encode($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/GZbfB
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr, !1 = $i, !2 = $pages, !3 = $page, !4 = $lab
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, 1
   19     2      > FE_RESET_R                                       $7      !2, ->18
          3    > > FE_FETCH_R                                               $7, !3, ->18
   20     4    >   PRE_INC                                                  !1
   22     5        INIT_ARRAY                                       ~11     'ListItem', '%40type'
   23     6        ADD_ARRAY_ELEMENT                                ~11     !1, 'position'
   25     7        INIT_METHOD_CALL                                         !3, 'getUri'
          8        DO_FCALL                                      0  $12     
          9        INIT_ARRAY                                       ~13     $12, '%40id'
   26    10        INIT_METHOD_CALL                                         !3, 'getLabel'
         11        DO_FCALL                                      0  $14     
         12        ADD_ARRAY_ELEMENT                                ~13     $14, 'name'
         13        ADD_ARRAY_ELEMENT                                ~11     ~13, 'item'
   21    14        FETCH_DIM_W                                      $9      !0, 'itemListElement'
         15        ASSIGN_DIM                                               $9
   26    16        OP_DATA                                                  ~11
   19    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $7
   30    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !0
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                                 
   31    23        INIT_FCALL                                               'json_encode'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.54 ms | 1399 KiB | 17 Q