3v4l.org

run code in 300+ PHP versions simultaneously
<?php $itinerary = array (array('portName'=>'Day At Sea'), array('portName'=>'Moscow'), array('portName'=>'Jupiter')); $badPorts = array('At Sea', 'Day At Sea', 'Cruising The Mediterranean Sea'); $image = ''; $arr = array(); array_walk($itinerary, function($item, $index) use(&$image, $badPorts, &$arr){ if(!in_array($item['portName'], $badPorts)) $arr[] = $index.":".$item['portName']; }); $image .= implode(',', $arr); var_dump($image); $image2 = ''; $arr2 = array(); foreach($itinerary as $index => $item){ if(!in_array($item['portName'], $badPorts)) $arr2[] = $index.":".$item['portName']; } $image2 .= implode(',', $arr2); var_dump($image2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 38
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 38
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 37
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/3OO2n
function name:  (null)
number of ops:  48
compiled vars:  !0 = $itinerary, !1 = $badPorts, !2 = $image, !3 = $arr, !4 = $image2, !5 = $arr2, !6 = $item, !7 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, ''
    6     3        ASSIGN                                                   !3, <array>
    7     4        INIT_FCALL                                               'array_walk'
          5        SEND_REF                                                 !0
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3OO2n%3A7%240'
          7        BIND_LEXICAL                                             ~12, !2
          8        BIND_LEXICAL                                             ~12, !1
          9        BIND_LEXICAL                                             ~12, !3
    9    10        SEND_VAL                                                 ~12
         11        DO_ICALL                                                 
   10    12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 '%2C'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $14     
         16        ASSIGN_OP                                     8          !2, $14
   11    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   13    20        ASSIGN                                                   !4, ''
   14    21        ASSIGN                                                   !5, <array>
   15    22      > FE_RESET_R                                       $19     !0, ->38
         23    > > FE_FETCH_R                                       ~20     $19, !6, ->38
         24    >   ASSIGN                                                   !7, ~20
   16    25        INIT_FCALL                                               'in_array'
         26        FETCH_DIM_R                                      ~22     !6, 'portName'
         27        SEND_VAL                                                 ~22
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $23     
         30        BOOL_NOT                                         ~24     $23
         31      > JMPZ                                                     ~24, ->37
         32    >   CONCAT                                           ~26     !7, '%3A'
         33        FETCH_DIM_R                                      ~27     !6, 'portName'
         34        CONCAT                                           ~28     ~26, ~27
         35        ASSIGN_DIM                                               !5
         36        OP_DATA                                                  ~28
   15    37    > > JMP                                                      ->23
         38    >   FE_FREE                                                  $19
   18    39        INIT_FCALL                                               'implode'
         40        SEND_VAL                                                 '%2C'
         41        SEND_VAR                                                 !5
         42        DO_ICALL                                         $29     
         43        ASSIGN_OP                                     8          !4, $29
   19    44        INIT_FCALL                                               'var_dump'
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3OO2n%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/3OO2n
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $item, !1 = $index, !2 = $image, !3 = $badPorts, !4 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
          4        BIND_STATIC                                              !4
    8     5        INIT_FCALL                                               'in_array'
          6        FETCH_DIM_R                                      ~5      !0, 'portName'
          7        SEND_VAL                                                 ~5
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $6      
         10        BOOL_NOT                                         ~7      $6
         11      > JMPZ                                                     ~7, ->17
         12    >   CONCAT                                           ~9      !1, '%3A'
         13        FETCH_DIM_R                                      ~10     !0, 'portName'
         14        CONCAT                                           ~11     ~9, ~10
         15        ASSIGN_DIM                                               !4
         16        OP_DATA                                                  ~11
    9    17    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3OO2n%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.3 ms | 1400 KiB | 21 Q