3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = [ "vasteras"=> [ [ "2017-06-02", "2017-06-12" ], [ "2017-04-01", "2017-04-08", "2017-04-15", ] ] ] ; $result = null; function get($array, $date){ foreach ($array as $item){ if(in_array($date, $item)){ return $item; } } } var_dump(get($ar['vasteras'],"2017-04-01"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIRa6
function name:  (null)
number of ops:  11
compiled vars:  !0 = $ar, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, null
   27     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'get'
          4        FETCH_DIM_R                                      ~4      !0, 'vasteras'
          5        SEND_VAL                                                 ~4
          6        SEND_VAL                                                 '2017-04-01'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/BIRa6
function name:  get
number of ops:  14
compiled vars:  !0 = $array, !1 = $date, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2      > FE_RESET_R                                       $3      !0, ->12
          3    > > FE_FETCH_R                                               $3, !2, ->12
   21     4    >   INIT_FCALL                                               'in_array'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->11
   22     9    >   FE_FREE                                                  $3
         10      > RETURN                                                   !2
   20    11    > > JMP                                                      ->3
         12    >   FE_FREE                                                  $3
   25    13      > RETURN                                                   null

End of function get

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.67 ms | 1399 KiB | 18 Q