3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUA($data, $univ_seg) { return array_filter(json_decode($data, true), function($var) use ($univ_seg) { return $var["EventType"] == "UN" && $var["LocationURL"] == $univ_seg; }); } $data = json_encode(array( array("StartDate"=>"2014/07/31","LocZipCode"=>"19406","LocationURL"=>"FSU","EventType"=>"UN"), array("StartDate"=>"2014/08/31","LocZipCode"=>"23513","LocationURL"=>"FSU","EventType"=>"UN"), array("StartDate"=>"2014/07/31","LocZipCode"=>"92108","LocationURL"=>"BU","EventType"=>"UN"), array("StartDate"=>"2014/09/30","LocZipCode"=>"78661","LocationURL"=>"BU","EventType"=>"UN") )); $univ_seg = 'FSU'; $ua = getUA($data, $univ_seg);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jneai
function name:  (null)
number of ops:  11
compiled vars:  !0 = $data, !1 = $univ_seg, !2 = $ua
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'json_encode'
    9     1        SEND_VAL                                                 <array>
          2        DO_ICALL                                         $3      
    8     3        ASSIGN                                                   !0, $3
   16     4        ASSIGN                                                   !1, 'FSU'
   18     5        INIT_FCALL                                               'getua'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !2, $6
         10      > RETURN                                                   1

Function getua:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jneai
function name:  getUA
number of ops:  14
compiled vars:  !0 = $data, !1 = $univ_seg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        INIT_FCALL                                               'array_filter'
          3        INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJneai%3A3%240'
          9        BIND_LEXICAL                                             ~3, !1
    5    10        SEND_VAL                                                 ~3
         11        DO_ICALL                                         $4      
         12      > RETURN                                                   $4
    6    13*     > RETURN                                                   null

End of function getua

Function %00%7Bclosure%7D%2Fin%2FJneai%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/Jneai
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $var, !1 = $univ_seg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    4     2        FETCH_DIM_R                                      ~2      !0, 'EventType'
          3        IS_EQUAL                                         ~3      ~2, 'UN'
          4      > JMPZ_EX                                          ~3      ~3, ->8
          5    >   FETCH_DIM_R                                      ~4      !0, 'LocationURL'
          6        IS_EQUAL                                         ~5      !1, ~4
          7        BOOL                                             ~3      ~5
          8    > > RETURN                                                   ~3
    5     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJneai%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.5 ms | 1403 KiB | 20 Q