3v4l.org

run code in 300+ 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:  27
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        INIT_FCALL                                               'trim'
          6        SEND_VAL                                                 'xx'
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   20     9        INIT_FCALL                                               'array_values'
         10        INIT_FCALL                                               'array_filter'
         11        FETCH_OBJ_R                                      ~9      !1, 'aaa'
         12        SEND_VAL                                                 ~9
         13        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
         14        BIND_LEXICAL                                             ~10, !2
   22    15        SEND_VAL                                                 ~10
   20    16        DO_ICALL                                         $11     
   22    17        SEND_VAR                                                 $11
   20    18        DO_ICALL                                         $12     
         19        ASSIGN_OBJ                                               !1, 'aaa'
   22    20        OP_DATA                                                  $12
   23    21        INIT_FCALL                                               'json_encode'
         22        SEND_VAR                                                 !1
         23        SEND_VAL                                                 128
         24        DO_ICALL                                         $13     
         25        ECHO                                                     $13
         26      > 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}
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.0.0


preferences:
151.09 ms | 1021 KiB | 19 Q