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'), ); $daily_html = ''; 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/>'; addDailyHtml( "Event", "$day-$month-$year", null, $daily_html);// there is some problem } var_dump($daily_html); function addDailyHtml( $html, $start_date_string, $end_date_string = null, &$daily_html ) { 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++; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 51
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 51
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
filename:       /in/fU6cP
function name:  (null)
number of ops:  56
compiled vars:  !0 = $result5, !1 = $daily_html, !2 = $row5, !3 = $time, !4 = $day, !5 = $month, !6 = $month2, !7 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, ''
   10     2      > FE_RESET_R                                       $10     !0, ->51
          3    > > FE_FETCH_R                                               $10, !2, ->51
   12     4    >   INIT_FCALL                                               'strtotime'
          5        FETCH_DIM_R                                      ~11     !2, 'start_date'
          6        SEND_VAL                                                 ~11
          7        DO_ICALL                                         $12     
          8        ASSIGN                                                   !3, $12
   13     9        INIT_FCALL                                               'date'
         10        SEND_VAL                                                 'd'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $14     
         13        ASSIGN                                                   !4, $14
   14    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'm'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !5, $16
   15    19        INIT_FCALL                                               'date'
         20        SEND_VAL                                                 'F'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $18     
         23        ASSIGN                                                   !6, $18
   16    24        INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'Y'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $20     
         28        ASSIGN                                                   !7, $20
   18    29        ROPE_INIT                                     6  ~23     !4
         30        ROPE_ADD                                      1  ~23     ~23, '+'
         31        ROPE_ADD                                      2  ~23     ~23, !5
         32        ROPE_ADD                                      3  ~23     ~23, '+'
         33        ROPE_ADD                                      4  ~23     ~23, !7
         34        ROPE_END                                      5  ~22     ~23, '+'
         35        FETCH_DIM_R                                      ~26     !2, 'name_event'
         36        CONCAT                                           ~27     ~22, ~26
         37        ECHO                                                     ~27
   19    38        ECHO                                                     '%3Cbr%2F%3E'
   21    39        INIT_FCALL_BY_NAME                                       'addDailyHtml'
         40        SEND_VAL_EX                                              'Event'
         41        ROPE_INIT                                     5  ~29     !4
         42        ROPE_ADD                                      1  ~29     ~29, '-'
         43        ROPE_ADD                                      2  ~29     ~29, !5
         44        ROPE_ADD                                      3  ~29     ~29, '-'
         45        ROPE_END                                      4  ~28     ~29, !7
         46        SEND_VAL_EX                                              ~28
         47        SEND_VAL_EX                                              null
         48        SEND_VAR_EX                                              !1
         49        DO_FCALL                                      0          
   10    50      > JMP                                                      ->3
         51    >   FE_FREE                                                  $10
   23    52        INIT_FCALL                                               'var_dump'
         53        SEND_VAR                                                 !1
         54        DO_ICALL                                                 
   42    55      > RETURN                                                   1

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

End of function adddailyhtml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.42 ms | 1404 KiB | 21 Q