3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isAvailable($date){ return ! in_array($date, array(3, 4, 5, 10, 11, 12, 23, 24, 25, 26)); } $a = array(); $consecutively = 0; $l = 0; for($i = 1; $i <= 30; $i++) { $isAvailable = isAvailable($i); $a[$i] = array('isAvailable' => $isAvailable); if($isAvailable) { $consecutively++; $a[$i]['consecutively'] =& $consecutively; } else { unset($consecutively); $consecutively = 0; } } print_r($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 5
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 5
Branch analysis from position: 23
Branch analysis from position: 5
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 5
Branch analysis from position: 23
Branch analysis from position: 5
filename:       /in/BQYrZ
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $consecutively, !2 = $l, !3 = $i, !4 = $isAvailable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, 0
    8     2        ASSIGN                                                   !2, 0
    9     3        ASSIGN                                                   !3, 1
          4      > JMP                                                      ->21
   11     5    >   INIT_FCALL                                               'isavailable'
          6        SEND_VAR                                                 !3
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !4, $9
   12     9        INIT_ARRAY                                       ~12     !4, 'isAvailable'
         10        ASSIGN_DIM                                               !0, !3
         11        OP_DATA                                                  ~12
   13    12      > JMPZ                                                     !4, ->18
   15    13    >   PRE_INC                                                  !1
   16    14        FETCH_DIM_W                                      $14     !0, !3
         15        FETCH_DIM_W                                      $15     $14, 'consecutively'
         16        ASSIGN_REF                                               $15, !1
         17      > JMP                                                      ->20
   20    18    >   UNSET_CV                                                 !1
   21    19        ASSIGN                                                   !1, 0
    9    20    >   PRE_INC                                                  !3
         21    >   IS_SMALLER_OR_EQUAL                                      !3, 30
         22      > JMPNZ                                                    ~19, ->5
   24    23    >   INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function isavailable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BQYrZ
function name:  isAvailable
number of ops:  8
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'in_array'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $1      
          5        BOOL_NOT                                         ~2      $1
          6      > RETURN                                                   ~2
    4     7*     > RETURN                                                   null

End of function isavailable

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.55 ms | 1403 KiB | 18 Q