3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result5 = array( array('start_date' => '2005-10-12', 'name_event' => 'test1'), array('start_date' => '2006-10-12', 'name_event' => 'test2'), ); foreach($result5 as $row5) { $time=strtotime($row5['start_date']); $day = date("d",$time); $month= date("m",$time); $month2= date("F",$time); $year=date("Y",$time); echo "$day $month $year ".$row5['name_event'] ; // this show me correct echo '<br/>'; $result = addDailyHtml( "Event", "$day-$month-$year");// there is some problem var_dump($result); } function addDailyHtml( $html, $start_date_string, $end_date_string = null ) { static $htmlCount = 0; $start_date = strtotime($start_date_string); if( $end_date_string ) { $end_date = strtotime($end_date_string); } else { $end_date = $start_date; } $working_date = $start_date; do { $tDate = getdate($working_date); $working_date += 86400; $daily_html[$tDate['year']][$tDate['mon']][$tDate['mday']][$htmlCount] = $html; } while( $working_date < $end_date + 1 ); $htmlCount++; return $daily_html; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 52
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 52
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
filename:       /in/QCOR1
function name:  (null)
number of ops:  54
compiled vars:  !0 = $result5, !1 = $row5, !2 = $time, !3 = $day, !4 = $month, !5 = $month2, !6 = $year, !7 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $9      !0, ->52
          2    > > FE_FETCH_R                                               $9, !1, ->52
   11     3    >   INIT_FCALL                                               'strtotime'
          4        FETCH_DIM_R                                      ~10     !1, 'start_date'
          5        SEND_VAL                                                 ~10
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !2, $11
   12     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'd'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $13     
         12        ASSIGN                                                   !3, $13
   13    13        INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'm'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $15     
         17        ASSIGN                                                   !4, $15
   14    18        INIT_FCALL                                               'date'
         19        SEND_VAL                                                 'F'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $17     
         22        ASSIGN                                                   !5, $17
   15    23        INIT_FCALL                                               'date'
         24        SEND_VAL                                                 'Y'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $19     
         27        ASSIGN                                                   !6, $19
   18    28        ROPE_INIT                                     6  ~22     !3
         29        ROPE_ADD                                      1  ~22     ~22, '+'
         30        ROPE_ADD                                      2  ~22     ~22, !4
         31        ROPE_ADD                                      3  ~22     ~22, '+'
         32        ROPE_ADD                                      4  ~22     ~22, !6
         33        ROPE_END                                      5  ~21     ~22, '+'
         34        FETCH_DIM_R                                      ~25     !1, 'name_event'
         35        CONCAT                                           ~26     ~21, ~25
         36        ECHO                                                     ~26
   19    37        ECHO                                                     '%3Cbr%2F%3E'
   21    38        INIT_FCALL_BY_NAME                                       'addDailyHtml'
         39        SEND_VAL_EX                                              'Event'
         40        ROPE_INIT                                     5  ~28     !3
         41        ROPE_ADD                                      1  ~28     ~28, '-'
         42        ROPE_ADD                                      2  ~28     ~28, !4
         43        ROPE_ADD                                      3  ~28     ~28, '-'
         44        ROPE_END                                      4  ~27     ~28, !6
         45        SEND_VAL_EX                                              ~27
         46        DO_FCALL                                      0  $31     
         47        ASSIGN                                                   !7, $31
   22    48        INIT_FCALL                                               'var_dump'
         49        SEND_VAR                                                 !7
         50        DO_ICALL                                                 
    9    51      > JMP                                                      ->2
         52    >   FE_FREE                                                  $9
   43    53      > RETURN                                                   1

Function adddailyhtml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 16
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 16
Branch analysis from position: 32
Branch analysis from position: 16
filename:       /in/QCOR1
function name:  addDailyHtml
number of ops:  35
compiled vars:  !0 = $html, !1 = $start_date_string, !2 = $end_date_string, !3 = $htmlCount, !4 = $start_date, !5 = $end_date, !6 = $working_date, !7 = $tDate, !8 = $daily_html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   26     3        BIND_STATIC                                              !3
   27     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !4, $9
   28     8      > JMPZ                                                     !2, ->14
   29     9    >   INIT_FCALL                                               'strtotime'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !5, $11
         13      > JMP                                                      ->15
   31    14    >   ASSIGN                                                   !5, !4
   34    15    >   ASSIGN                                                   !6, !4
   36    16    >   INIT_FCALL                                               'getdate'
         17        SEND_VAR                                                 !6
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !7, $15
   37    20        ASSIGN_OP                                     1          !6, 86400
   38    21        FETCH_DIM_R                                      ~18     !7, 'year'
         22        FETCH_DIM_R                                      ~20     !7, 'mon'
         23        FETCH_DIM_R                                      ~22     !7, 'mday'
         24        FETCH_DIM_W                                      $19     !8, ~18
         25        FETCH_DIM_W                                      $21     $19, ~20
         26        FETCH_DIM_W                                      $23     $21, ~22
         27        ASSIGN_DIM                                               $23, !3
         28        OP_DATA                                                  !0
   39    29        ADD                                              ~25     !5, 1
         30        IS_SMALLER                                               !6, ~25
         31      > JMPNZ                                                    ~26, ->16
   41    32    >   PRE_INC                                                  !3
   42    33      > RETURN                                                   !8
   43    34*     > RETURN                                                   null

End of function adddailyhtml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.12 ms | 1404 KiB | 21 Q