3v4l.org

run code in 300+ PHP versions simultaneously
<?php $paths = array( 'one' => array( 'visited' => false, 'shortest_path' => INF, 'neighbors' => array( 'two' => array(1 => bus), 'three' => array(5 => subway), 'fow' => array(10 => bus), ) ), 'two' => array( 'visited' => false, 'shortest_path' => INF, 'neighbors' => array( 'one' => array(1 => bus), ) ), 'three' => array( 'visited' => false, 'shortest_path' => INF, 'neighbors' => array( 'one' => array(5 => bus), 'six' => array(20 => foot) ) ), 'fow' => array( 'visited' => false, 'shortest_path' => INF, 'neighbors' => array( 'one' => array(10 => bus), 'five' => array(5 => bus) ) ), 'five' => array( 'visited' => false, 'shortest_path' => INF, 'neighbors' => array( 'fow' => array(5 => bus), 'six' => array(5 => foot) ) ), 'six' => array( 'visited' => false, 'shortest_path' => INF, 'neighbors' => array( 'three' => array(20 => bus), 'five' => array(5 => foot) ) ) ); $array = array ( 0 => 'two ', 1 => 'three ', 2 => 'fow ', 3 => 'five ', 4 => 'six ', 5 => 'six ', ); // sort ДЛЯ СОРТИРОВКИ foreach ($array as $key => $name) { echo $name."\n"; if (count($paths[$name][neighbors]) >=2 ) { echo 123; foreach ($paths[$name][neighbors] as $neighbor) { if ($array[$key+1] == $neighbor) { echo $name; } } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 63, Position 2 = 87
Branch analysis from position: 63
2 jumps found. (Code = 78) Position 1 = 64, Position 2 = 87
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 86
Branch analysis from position: 73
2 jumps found. (Code = 77) Position 1 = 78, Position 2 = 85
Branch analysis from position: 78
2 jumps found. (Code = 78) Position 1 = 79, Position 2 = 85
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 84
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
Branch analysis from position: 84
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 85
Branch analysis from position: 86
Branch analysis from position: 87
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 87
filename:       /in/3b26v
function name:  (null)
number of ops:  89
compiled vars:  !0 = $paths, !1 = $array, !2 = $name, !3 = $key, !4 = $neighbor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_ARRAY                                       ~5      <false>, 'visited'
          1        ADD_ARRAY_ELEMENT                                ~5      INF, 'shortest_path'
    8     2        FETCH_CONSTANT                                   ~6      'bus'
          3        INIT_ARRAY                                       ~7      ~6, 1
          4        INIT_ARRAY                                       ~8      ~7, 'two'
    9     5        FETCH_CONSTANT                                   ~9      'subway'
          6        INIT_ARRAY                                       ~10     ~9, 5
          7        ADD_ARRAY_ELEMENT                                ~8      ~10, 'three'
   10     8        FETCH_CONSTANT                                   ~11     'bus'
          9        INIT_ARRAY                                       ~12     ~11, 10
         10        ADD_ARRAY_ELEMENT                                ~8      ~12, 'fow'
         11        ADD_ARRAY_ELEMENT                                ~5      ~8, 'neighbors'
         12        INIT_ARRAY                                       ~13     ~5, 'one'
    5    13        INIT_ARRAY                                       ~14     <false>, 'visited'
         14        ADD_ARRAY_ELEMENT                                ~14     INF, 'shortest_path'
   18    15        FETCH_CONSTANT                                   ~15     'bus'
         16        INIT_ARRAY                                       ~16     ~15, 1
         17        INIT_ARRAY                                       ~17     ~16, 'one'
         18        ADD_ARRAY_ELEMENT                                ~14     ~17, 'neighbors'
         19        ADD_ARRAY_ELEMENT                                ~13     ~14, 'two'
    5    20        INIT_ARRAY                                       ~18     <false>, 'visited'
         21        ADD_ARRAY_ELEMENT                                ~18     INF, 'shortest_path'
   26    22        FETCH_CONSTANT                                   ~19     'bus'
         23        INIT_ARRAY                                       ~20     ~19, 5
         24        INIT_ARRAY                                       ~21     ~20, 'one'
   27    25        FETCH_CONSTANT                                   ~22     'foot'
         26        INIT_ARRAY                                       ~23     ~22, 20
         27        ADD_ARRAY_ELEMENT                                ~21     ~23, 'six'
         28        ADD_ARRAY_ELEMENT                                ~18     ~21, 'neighbors'
         29        ADD_ARRAY_ELEMENT                                ~13     ~18, 'three'
    5    30        INIT_ARRAY                                       ~24     <false>, 'visited'
         31        ADD_ARRAY_ELEMENT                                ~24     INF, 'shortest_path'
   35    32        FETCH_CONSTANT                                   ~25     'bus'
         33        INIT_ARRAY                                       ~26     ~25, 10
         34        INIT_ARRAY                                       ~27     ~26, 'one'
   36    35        FETCH_CONSTANT                                   ~28     'bus'
         36        INIT_ARRAY                                       ~29     ~28, 5
         37        ADD_ARRAY_ELEMENT                                ~27     ~29, 'five'
         38        ADD_ARRAY_ELEMENT                                ~24     ~27, 'neighbors'
         39        ADD_ARRAY_ELEMENT                                ~13     ~24, 'fow'
    5    40        INIT_ARRAY                                       ~30     <false>, 'visited'
         41        ADD_ARRAY_ELEMENT                                ~30     INF, 'shortest_path'
   44    42        FETCH_CONSTANT                                   ~31     'bus'
         43        INIT_ARRAY                                       ~32     ~31, 5
         44        INIT_ARRAY                                       ~33     ~32, 'fow'
   45    45        FETCH_CONSTANT                                   ~34     'foot'
         46        INIT_ARRAY                                       ~35     ~34, 5
         47        ADD_ARRAY_ELEMENT                                ~33     ~35, 'six'
         48        ADD_ARRAY_ELEMENT                                ~30     ~33, 'neighbors'
         49        ADD_ARRAY_ELEMENT                                ~13     ~30, 'five'
    5    50        INIT_ARRAY                                       ~36     <false>, 'visited'
         51        ADD_ARRAY_ELEMENT                                ~36     INF, 'shortest_path'
   53    52        FETCH_CONSTANT                                   ~37     'bus'
         53        INIT_ARRAY                                       ~38     ~37, 20
         54        INIT_ARRAY                                       ~39     ~38, 'three'
   54    55        FETCH_CONSTANT                                   ~40     'foot'
         56        INIT_ARRAY                                       ~41     ~40, 5
         57        ADD_ARRAY_ELEMENT                                ~39     ~41, 'five'
         58        ADD_ARRAY_ELEMENT                                ~36     ~39, 'neighbors'
         59        ADD_ARRAY_ELEMENT                                ~13     ~36, 'six'
    3    60        ASSIGN                                                   !0, ~13
   59    61        ASSIGN                                                   !1, <array>
   74    62      > FE_RESET_R                                       $44     !1, ->87
         63    > > FE_FETCH_R                                       ~45     $44, !2, ->87
         64    >   ASSIGN                                                   !3, ~45
   75    65        CONCAT                                           ~47     !2, '%0A'
         66        ECHO                                                     ~47
   76    67        FETCH_CONSTANT                                   ~49     'neighbors'
         68        FETCH_DIM_R                                      ~48     !0, !2
         69        FETCH_DIM_R                                      ~50     ~48, ~49
         70        COUNT                                            ~51     ~50
         71        IS_SMALLER_OR_EQUAL                                      2, ~51
         72      > JMPZ                                                     ~52, ->86
   77    73    >   ECHO                                                     123
   78    74        FETCH_CONSTANT                                   ~54     'neighbors'
         75        FETCH_DIM_R                                      ~53     !0, !2
         76        FETCH_DIM_R                                      ~55     ~53, ~54
         77      > FE_RESET_R                                       $56     ~55, ->85
         78    > > FE_FETCH_R                                               $56, !4, ->85
   79    79    >   ADD                                              ~57     !3, 1
         80        FETCH_DIM_R                                      ~58     !1, ~57
         81        IS_EQUAL                                                 !4, ~58
         82      > JMPZ                                                     ~59, ->84
   80    83    >   ECHO                                                     !2
   78    84    > > JMP                                                      ->78
         85    >   FE_FREE                                                  $56
   74    86    > > JMP                                                      ->63
         87    >   FE_FREE                                                  $44
   84    88      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.48 ms | 1403 KiB | 13 Q