3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1.5 => "rate", false => "hood", true => "love", "2" => "late", 4 => "site"); $del = function ( $array, $key ) { unset( $array[ $key ] ); return array_values( $array ); }; $seek = "hood"; if ( ( $dex = array_search( $seek, $arr ) ) !== false) { $arr = $del( $arr, $dex ); } var_dump($arr); //[1 => "love", 0 => “hood”, 2 => "late", 4 => ”site”]
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/kGDJo
function name:  (null)
number of ops:  20
compiled vars:  !0 = $arr, !1 = $del, !2 = $seek, !3 = $dex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkGDJo%3A6%240'
          2        ASSIGN                                                   !1, ~5
   10     3        ASSIGN                                                   !2, 'hood'
   11     4        INIT_FCALL                                               'array_search'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ASSIGN                                           ~9      !3, $8
          9        TYPE_CHECK                                  1018          ~9
         10      > JMPZ                                                     ~10, ->16
   13    11    >   INIT_DYNAMIC_CALL                                        !1
         12        SEND_VAR_EX                                              !0
         13        SEND_VAR_EX                                              !3
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                                   !0, $11
   15    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FkGDJo%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kGDJo
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $array, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        UNSET_DIM                                                !0, !1
    8     3        INIT_FCALL                                               'array_values'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    9     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FkGDJo%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.11 ms | 1388 KiB | 19 Q