3v4l.org

run code in 300+ PHP versions simultaneously
<?php function duration($beginn,$ende) { $s = new DateTime($beginn); $e = new DateTime($ende); $interval = new DateInterval('P1M'); $period = new DatePeriod($s, $interval, $e); $m = 0; foreach ($period as $dt) { $m++; } return $m; } echo duration('2014-05-01','2016-04-30');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LUDH2
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'duration'
          1        SEND_VAL                                                 '2014-05-01'
          2        SEND_VAL                                                 '2016-04-30'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function duration:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/LUDH2
function name:  duration
number of ops:  28
compiled vars:  !0 = $beginn, !1 = $ende, !2 = $s, !3 = $e, !4 = $interval, !5 = $period, !6 = $m, !7 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        NEW                                              $8      'DateTime'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $8
    5     6        NEW                                              $11     'DateTime'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $11
    6    10        NEW                                              $14     'DateInterval'
         11        SEND_VAL_EX                                              'P1M'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !4, $14
    7    14        NEW                                              $17     'DatePeriod'
         15        SEND_VAR_EX                                              !2
         16        SEND_VAR_EX                                              !4
         17        SEND_VAR_EX                                              !3
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !5, $17
    8    20        ASSIGN                                                   !6, 0
    9    21      > FE_RESET_R                                       $21     !5, ->25
         22    > > FE_FETCH_R                                               $21, !7, ->25
   10    23    >   PRE_INC                                                  !6
    9    24      > JMP                                                      ->22
         25    >   FE_FREE                                                  $21
   12    26      > RETURN                                                   !6
   13    27*     > RETURN                                                   null

End of function duration

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.97 ms | 1399 KiB | 14 Q