3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 0 => array ( 'week_startDate' => '2019-02-01', 'week_endDate' => '2019-02-03' ), 1 => array ( 'week_startDate' => '2019-02-04', 'week_endDate' => '2019-02-10' ), 2 => array ( 'week_startDate' => '2019-02-11', 'week_endDate' => '2019-02-17' ), 3 => array ( 'week_startDate' => '2019-02-18', 'week_endDate' => '2019-02-24' ), 4 => array ( 'week_startDate' => '2019-02-25', 'week_endDate' => '2019-02-28' ) ); $startDate = '2019-02-01'; $k = array_search($startDate, array_column($array, 'week_startDate')); if ($k !== false) { $endDate = $array[$k]['week_endDate']; echo "end date is $endDate"; } else { echo "$startDate not found!"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kSOCJ
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $startDate, !2 = $k, !3 = $endDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   30     1        ASSIGN                                                   !1, '2019-02-01'
   31     2        INIT_FCALL                                               'array_search'
          3        SEND_VAR                                                 !1
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'week_startDate'
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
   32    11        TYPE_CHECK                                  1018          !2
         12      > JMPZ                                                     ~9, ->20
   33    13    >   FETCH_DIM_R                                      ~10     !0, !2
         14        FETCH_DIM_R                                      ~11     ~10, 'week_endDate'
         15        ASSIGN                                                   !3, ~11
   34    16        NOP                                                      
         17        FAST_CONCAT                                      ~13     'end+date+is+', !3
         18        ECHO                                                     ~13
         19      > JMP                                                      ->23
   37    20    >   NOP                                                      
         21        FAST_CONCAT                                      ~14     !1, '+not+found%21'
         22        ECHO                                                     ~14
   38    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.85 ms | 1395 KiB | 17 Q