3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( '3' => 10, '2' => 2, '5' => 'Nakiya', ); /** * Removes a particular value from an array * * @param string $array * @param string $value * * @return array */ function removearrayValue($array, $value) { $IsNumericArray = true; foreach ($array as $key => $item) { if ($item === $value) { if (!is_int($key)) { $IsNumericArray = false; } unset($array[$key]); } } if ($IsNumericArray) { $array = array_values($array); } return $array; } var_dump(removearrayValue($array,'Nakiya'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FcAD5
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   38     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'removearrayvalue'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'Nakiya'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function removearrayvalue:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
Branch analysis from position: 13
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 14
filename:       /in/FcAD5
function name:  removearrayValue
number of ops:  22
compiled vars:  !0 = $array, !1 = $value, !2 = $IsNumericArray, !3 = $item, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        ASSIGN                                                   !2, <true>
   22     3      > FE_RESET_R                                       $6      !0, ->14
          4    > > FE_FETCH_R                                       ~7      $6, !3, ->14
          5    >   ASSIGN                                                   !4, ~7
   23     6        IS_IDENTICAL                                             !3, !1
          7      > JMPZ                                                     ~9, ->13
   24     8    >   TYPE_CHECK                                   16  ~10     !4
          9        BOOL_NOT                                         ~11     ~10
         10      > JMPZ                                                     ~11, ->12
   25    11    >   ASSIGN                                                   !2, <false>
   27    12    >   UNSET_DIM                                                !0, !4
   22    13    > > JMP                                                      ->4
         14    >   FE_FREE                                                  $6
   30    15      > JMPZ                                                     !2, ->20
   31    16    >   INIT_FCALL                                               'array_values'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !0, $13
   34    20    > > RETURN                                                   !0
   35    21*     > RETURN                                                   null

End of function removearrayvalue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.56 ms | 963 KiB | 16 Q