3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 'foo', 'foo', 'bar', 'baz', 'baz' ]; array_walk($arr, function (&$item, $k) use ($arr) { $lower = mb_strtolower($item, 'utf-8'); foreach ($arr as $i => $v) { var_dump($k .'='. $i); if ($i !== $k && $v !== null && $lower === mb_strtolower($v, 'utf-8')) { $item = null; } } }); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6KiAk
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F6KiAk%3A10%240'
          4        BIND_LEXICAL                                             ~2, !0
   18     5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
   19     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F6KiAk%3A10%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 30
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 30
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 27
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 29
Branch analysis from position: 27
Branch analysis from position: 20
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/6KiAk
function name:  {closure}
number of ops:  32
compiled vars:  !0 = $item, !1 = $k, !2 = $arr, !3 = $lower, !4 = $v, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   11     3        INIT_FCALL                                               'mb_strtolower'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'utf-8'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !3, $6
   12     8      > FE_RESET_R                                       $8      !2, ->30
          9    > > FE_FETCH_R                                       ~9      $8, !4, ->30
         10    >   ASSIGN                                                   !5, ~9
   13    11        INIT_FCALL                                               'var_dump'
         12        CONCAT                                           ~11     !1, '%3D'
         13        CONCAT                                           ~12     ~11, !5
         14        SEND_VAL                                                 ~12
         15        DO_ICALL                                                 
   14    16        IS_NOT_IDENTICAL                                 ~14     !5, !1
         17      > JMPZ_EX                                          ~14     ~14, ->20
         18    >   TYPE_CHECK                                  1020  ~15     !4
         19        BOOL                                             ~14     ~15
         20    > > JMPZ_EX                                          ~14     ~14, ->27
         21    >   INIT_FCALL                                               'mb_strtolower'
         22        SEND_VAR                                                 !4
         23        SEND_VAL                                                 'utf-8'
         24        DO_ICALL                                         $16     
         25        IS_IDENTICAL                                     ~17     !3, $16
         26        BOOL                                             ~14     ~17
         27    > > JMPZ                                                     ~14, ->29
   15    28    >   ASSIGN                                                   !0, null
   12    29    > > JMP                                                      ->9
         30    >   FE_FREE                                                  $8
   18    31      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F6KiAk%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.73 ms | 1405 KiB | 19 Q