3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Count the number of days since the beginning of the year. // // DD:MM:YYYY function dayCount($date) { $day = strtok($date, ":"); // print $day; $month = strtok(":") - 1; // print $month; $months = array(31,28,31,30,31,30,31,31,30,31,30,31); for ($i = 0; $i < $month; $i++) { $days += $months[$i]; } $days += $day; print $days; } dayCount("17:12:2012"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F2aP4
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'daycount'
          1        SEND_VAL                                                 '17%3A12%3A2012'
          2        DO_FCALL                                      0          
   29     3      > RETURN                                                   1

Function daycount:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 14
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 14
Branch analysis from position: 19
Branch analysis from position: 14
filename:       /in/F2aP4
function name:  dayCount
number of ops:  22
compiled vars:  !0 = $date, !1 = $day, !2 = $month, !3 = $months, !4 = $i, !5 = $days
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'strtok'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%3A'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   12     6        INIT_FCALL                                               'strtok'
          7        SEND_VAL                                                 '%3A'
          8        DO_ICALL                                         $8      
          9        SUB                                              ~9      $8, 1
         10        ASSIGN                                                   !2, ~9
   15    11        ASSIGN                                                   !3, <array>
   17    12        ASSIGN                                                   !4, 0
         13      > JMP                                                      ->17
   19    14    >   FETCH_DIM_R                                      ~13     !3, !4
         15        ASSIGN_OP                                     1          !5, ~13
   17    16        PRE_INC                                                  !4
         17    >   IS_SMALLER                                               !4, !2
         18      > JMPNZ                                                    ~16, ->14
   22    19    >   ASSIGN_OP                                     1          !5, !1
   24    20        ECHO                                                     !5
   25    21      > RETURN                                                   null

End of function daycount

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.99 ms | 1398 KiB | 16 Q