3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "ip_address": [ { "access": "private", "address": "x.x.x.x", "family": "IPv4" }, { "access": "public", "address": "xxxx:xxxx:xxxx:xxx:xxxx:xxxx:xxxx:xxxx", "family": "IPv6" }, { "access": "public", "address": "xxx.xxx.xxx.xxx", "family": "IPv4", "part_of_plan": "yes" } ] }'; $rr = array_filter(json_decode($json, true)['ip_address'], function($v){ return ($v['family'] === 'IPv4' && $v['access'] === 'public'); }); print_r($rr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0M0V
function name:  (null)
number of ops:  16
compiled vars:  !0 = $json, !1 = $rr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B+%22ip_address%22%3A+%5B+%7B+%22access%22%3A+%22private%22%2C+%22address%22%3A+%22x.x.x.x%22%2C+%22family%22%3A+%22IPv4%22+%7D%2C+%7B+%22access%22%3A+%22public%22%2C+%22address%22%3A+%22xxxx%3Axxxx%3Axxxx%3Axxx%3Axxxx%3Axxxx%3Axxxx%3Axxxx%22%2C+%22family%22%3A+%22IPv6%22+%7D%2C+%7B+%22access%22%3A+%22public%22%2C+%22address%22%3A+%22xxx.xxx.xxx.xxx%22%2C+%22family%22%3A+%22IPv4%22%2C+%22part_of_plan%22%3A+%22yes%22+%7D+%5D+%7D'
    5     1        INIT_FCALL                                               'array_filter'
          2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $3      
          6        FETCH_DIM_R                                      ~4      $3, 'ip_address'
          7        SEND_VAL                                                 ~4
          8        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
    7     9        SEND_VAL                                                 ~5
    5    10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !1, $6
    8    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/k0M0V
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_DIM_R                                      ~1      !0, 'family'
          2        IS_IDENTICAL                                     ~2      ~1, 'IPv4'
          3      > JMPZ_EX                                          ~2      ~2, ->7
          4    >   FETCH_DIM_R                                      ~3      !0, 'access'
          5        IS_IDENTICAL                                     ~4      ~3, 'public'
          6        BOOL                                             ~2      ~4
          7    > > RETURN                                                   ~2
    7     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.96 ms | 1013 KiB | 16 Q