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("15:01:2012"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/17lB5
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                                                 '15%3A01%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 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 16
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 16
Branch analysis from position: 21
Branch analysis from position: 16
filename:       /in/17lB5
function name:  dayCount
number of ops:  24
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
   10     6        ECHO                                                     !1
   12     7        INIT_FCALL                                               'strtok'
          8        SEND_VAL                                                 '%3A'
          9        DO_ICALL                                         $8      
         10        SUB                                              ~9      $8, 1
         11        ASSIGN                                                   !2, ~9
   13    12        ECHO                                                     !2
   15    13        ASSIGN                                                   !3, <array>
   17    14        ASSIGN                                                   !4, 0
         15      > JMP                                                      ->19
   19    16    >   FETCH_DIM_R                                      ~13     !3, !4
         17        ASSIGN_OP                                     1          !5, ~13
   17    18        PRE_INC                                                  !4
         19    >   IS_SMALLER                                               !4, !2
         20      > JMPNZ                                                    ~16, ->16
   22    21    >   ASSIGN_OP                                     1          !5, !1
   24    22        ECHO                                                     !5
   25    23      > RETURN                                                   null

End of function daycount

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.09 ms | 1399 KiB | 16 Q