3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1 = new DateTime('2010-01-11'); $d2 = new DateTime(date('Y-d-m'));//use same format that was used in d1 $diff = $d2->diff($d1); //code to display number of days into seperate digits $str = "".$diff->days; $size = strlen($str); $i=0; while($i<$size) { echo "<div>$str[$i]</div>"; $i++; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 22
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 22
Branch analysis from position: 30
Branch analysis from position: 22
filename:       /in/t7MdI
function name:  (null)
number of ops:  31
compiled vars:  !0 = $d1, !1 = $d2, !2 = $diff, !3 = $str, !4 = $size, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'DateTime'
          1        SEND_VAL_EX                                              '2010-01-11'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    3     4        NEW                                              $9      'DateTime'
          5        INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'Y-d-m'
          7        DO_ICALL                                         $10     
          8        SEND_VAR_NO_REF_EX                                       $10
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $9
    4    11        INIT_METHOD_CALL                                         !1, 'diff'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !2, $13
    7    15        FETCH_OBJ_R                                      ~15     !2, 'days'
         16        CONCAT                                           ~16     '', ~15
         17        ASSIGN                                                   !3, ~16
    8    18        STRLEN                                           ~18     !3
         19        ASSIGN                                                   !4, ~18
    9    20        ASSIGN                                                   !5, 0
   10    21      > JMP                                                      ->28
   12    22    >   ROPE_INIT                                     3  ~23     '%3Cdiv%3E'
         23        FETCH_DIM_R                                      ~21     !3, !5
         24        ROPE_ADD                                      1  ~23     ~23, ~21
         25        ROPE_END                                      2  ~22     ~23, '%3C%2Fdiv%3E'
         26        ECHO                                                     ~22
   13    27        PRE_INC                                                  !5
   10    28    >   IS_SMALLER                                               !5, !4
         29      > JMPNZ                                                    ~26, ->22
   14    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.42 ms | 1396 KiB | 15 Q