3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<_JSON [{ "Rating": "1600", "ID": "16733310", "Name": "LARRATEGUI,MARTIN", "Expires": "1000.10.10" },{ "Rating": "1353", "ID": "16429901", "Name": "ADDABBO,ERIC M", "Expires": "1000.10.10" }] _JSON; $array = json_decode($json, true); $filter = ['ID' => true]; $newArray = array_map(function($item) use ($filter) { return array_diff_key($item, $filter); }, $array); echo json_encode($newArray, JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3nvtA
function name:  (null)
number of ops:  20
compiled vars:  !0 = $json, !1 = $array, !2 = $filter, !3 = $newArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%7B%0A++%22Rating%22%3A+%221600%22%2C%0A++%22ID%22%3A+%2216733310%22%2C%0A++%22Name%22%3A+%22LARRATEGUI%2CMARTIN%22%2C%0A++%22Expires%22%3A+%221000.10.10%22%0A%7D%2C%7B%0A++%22Rating%22%3A+%221353%22%2C%0A++%22ID%22%3A+%2216429901%22%2C%0A++%22Name%22%3A+%22ADDABBO%2CERIC+M%22%2C%0A++%22Expires%22%3A+%221000.10.10%22%0A%7D%5D'
   17     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   18     6        ASSIGN                                                   !2, <array>
   19     7        INIT_FCALL                                               'array_map'
          8        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
          9        BIND_LEXICAL                                             ~8, !2
   21    10        SEND_VAL                                                 ~8
         11        SEND_VAR                                                 !1
   19    12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
   23    14        INIT_FCALL                                               'json_encode'
         15        SEND_VAR                                                 !3
         16        SEND_VAL                                                 128
         17        DO_ICALL                                         $11     
         18        ECHO                                                     $11
         19      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3nvtA
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $item, !1 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   20     2        INIT_FCALL                                               'array_diff_key'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   21     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.07 ms | 1014 KiB | 17 Q