3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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(":"); 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/79Q0I
function name:  (null)
number of ops:  5
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   NOP                                                      
  27     1        INIT_FCALL                                               'daycount'
         2        SEND_VAL                                                 '15%3A01%3A2012'
         3        DO_FCALL                                      0          
  29     4      > 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 = 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 15
Branch analysis from position: 21
Branch analysis from position: 15
filename:       /in/79Q0I
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        ASSIGN                                                   !2, $8
  13    11        ECHO                                                     !2
  15    12        ASSIGN                                                   !3, <array>
  17    13        ASSIGN                                                   !4, 0
        14      > JMP                                                      ->19
  19    15    >   FETCH_DIM_R                                      $12     !3, !4
        16        ASSIGN_ADD                                    0          !5, $12
  17    17        POST_INC                                         ~14     !4
        18        FREE                                                     ~14
        19    >   IS_SMALLER                                       ~15     !4, !2
        20      > JMPNZ                                                    ~15, ->15
  22    21    >   ASSIGN_ADD                                    0          !5, !1
  24    22        ECHO                                                     !5
  25    23      > RETURN                                                   null

End of function daycount

Generated using Vulcan Logic Dumper, using php 7.3.0