3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = <<<_JSON { "aaa": [ { "title": "xx", "description": "6" }, { "title": "tt", "description": "b" } ] } _JSON; $data = json_decode($json); $title = trim('xx'); $data->aaa = array_values(array_filter($data->aaa, function($item) use ($title) { return (bool) strcmp($item->title, $title); })); echo json_encode($data, JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/60MoG
function name:  (null)
number of ops:  25
compiled vars:  !0 = $json, !1 = $data, !2 = $title
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%7B%0A+++++%22aaa%22%3A+%5B%0A+++++++++%7B%0A+++++++++++++%22title%22%3A+%22xx%22%2C%0A+++++++++++++%22description%22%3A+%226%22%0A+++++++++%7D%2C%0A+++++++++%7B%0A+++++++++++++%22title%22%3A+%22tt%22%2C%0A+++++++++++++%22description%22%3A+%22b%22%0A+++++++++%7D%0A+++++%5D%0A%7D'
   18     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $4      
          4        ASSIGN                                                       !1, $4
   19     5        FRAMELESS_ICALL_1                trim                ~6      'xx'
          6        ASSIGN                                                       !2, ~6
   20     7        INIT_FCALL                                                   'array_values'
          8        INIT_FCALL                                                   'array_filter'
          9        FETCH_OBJ_R                                          ~9      !1, 'aaa'
         10        SEND_VAL                                                     ~9
         11        DECLARE_LAMBDA_FUNCTION                              ~10     [0]
         12        BIND_LEXICAL                                                 ~10, !2
   22    13        SEND_VAL                                                     ~10
   20    14        DO_ICALL                                             $11     
   22    15        SEND_VAR                                                     $11
   20    16        DO_ICALL                                             $12     
         17        ASSIGN_OBJ                                                   !1, 'aaa'
   22    18        OP_DATA                                                      $12
   23    19        INIT_FCALL                                                   'json_encode'
         20        SEND_VAR                                                     !1
         21        SEND_VAL                                                     128
         22        DO_ICALL                                             $13     
         23        ECHO                                                         $13
         24      > 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/60MoG
function name:  {closure:/in/60MoG:20}
number of ops:  10
compiled vars:  !0 = $item, !1 = $title
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   21     2        INIT_FCALL                                                   'strcmp'
          3        FETCH_OBJ_R                                          ~2      !0, 'title'
          4        SEND_VAL                                                     ~2
          5        SEND_VAR                                                     !1
          6        DO_ICALL                                             $3      
          7        BOOL                                                 ~4      $3
          8      > RETURN                                                       ~4
   22     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
209.31 ms | 2616 KiB | 18 Q