3v4l.org

run code in 300+ PHP versions simultaneously
<ul> <?php $values = array(); $values[] = array('example'=>'example1','date'=>'2016-12-25'); $values[] = array('example'=>'example2','date'=>'2016-12-26'); $values[] = array('example'=>'example3','date'=>'2016-12-28'); $values[] = array('example'=>'example4','date'=>'2016-12-30'); $previous = null; foreach($values as $example){ echo $previous; echo "<li>".$example['example']." - ".$example['date']; if ($previous !== null) { $diff = strtotime($example['date'])-strtotime($previous); echo " - ".($diff/(60*60*24)); } $previous = $example['date']; echo "</li>\n"; } ?> </ul>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 38
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 38
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 34
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 34
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/8EHvQ
function name:  (null)
number of ops:  41
compiled vars:  !0 = $values, !1 = $previous, !2 = $example, !3 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Cul%3E%0A'
    3     1        ASSIGN                                                   !0, <array>
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    5     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  <array>
    6     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  <array>
    7     8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  <array>
    9    10        ASSIGN                                                   !1, null
   10    11      > FE_RESET_R                                       $10     !0, ->38
         12    > > FE_FETCH_R                                               $10, !2, ->38
   12    13    >   ECHO                                                     !1
   13    14        FETCH_DIM_R                                      ~11     !2, 'example'
         15        CONCAT                                           ~12     '%3Cli%3E', ~11
         16        CONCAT                                           ~13     ~12, '+-+'
         17        FETCH_DIM_R                                      ~14     !2, 'date'
         18        CONCAT                                           ~15     ~13, ~14
         19        ECHO                                                     ~15
   15    20        TYPE_CHECK                                  1020          !1
         21      > JMPZ                                                     ~16, ->34
   16    22    >   INIT_FCALL                                               'strtotime'
         23        FETCH_DIM_R                                      ~17     !2, 'date'
         24        SEND_VAL                                                 ~17
         25        DO_ICALL                                         $18     
         26        INIT_FCALL                                               'strtotime'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $19     
         29        SUB                                              ~20     $18, $19
         30        ASSIGN                                                   !3, ~20
   17    31        DIV                                              ~22     !3, 86400
         32        CONCAT                                           ~23     '+-+', ~22
         33        ECHO                                                     ~23
   20    34    >   FETCH_DIM_R                                      ~24     !2, 'date'
         35        ASSIGN                                                   !1, ~24
   21    36        ECHO                                                     '%3C%2Fli%3E%0A'
   10    37      > JMP                                                      ->12
         38    >   FE_FREE                                                  $10
   25    39        ECHO                                                     '%3C%2Ful%3E'
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.44 ms | 1392 KiB | 15 Q