3v4l.org

run code in 300+ PHP versions simultaneously
<?php function daycount($day, $startdate, $enddate, $counter) { if($startdate >= $enddate) { return $counter; } else { return daycount($day, strtotime("next ".$day, $startdate), $enddate, ++$counter); } } echo daycount("monday", strtotime("18.01.2016"), 0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6mpvn
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'daycount'
          1        SEND_VAL                                                 'monday'
          2        INIT_FCALL                                               'strtotime'
          3        SEND_VAL                                                 '18.01.2016'
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        SEND_VAL                                                 0
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
          9      > RETURN                                                   1

Function daycount:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6mpvn
function name:  daycount
number of ops:  22
compiled vars:  !0 = $day, !1 = $startdate, !2 = $enddate, !3 = $counter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    5     4        IS_SMALLER_OR_EQUAL                                      !2, !1
          5      > JMPZ                                                     ~4, ->8
    7     6    > > RETURN                                                   !3
          7*       JMP                                                      ->21
   11     8    >   INIT_FCALL_BY_NAME                                       'daycount'
          9        SEND_VAR_EX                                              !0
         10        INIT_FCALL                                               'strtotime'
         11        CONCAT                                           ~5      'next+', !0
         12        SEND_VAL                                                 ~5
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $6      
         15        SEND_VAR_NO_REF_EX                                       $6
         16        SEND_VAR_EX                                              !2
         17        PRE_INC                                          ~7      !3
         18        SEND_VAL_EX                                              ~7
         19        DO_FCALL                                      0  $8      
         20      > RETURN                                                   $8
   13    21*     > RETURN                                                   null

End of function daycount

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.69 ms | 1399 KiB | 16 Q