3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getQuarterEndingOf($month) { $quarterEndings = [ 1 => 'Mar', 2 => 'Mar', 3 => 'Mar', 4 => 'Jun', 5 => 'Jun', 6 => 'Jun', 7 => 'Sep', 8 => 'Sep', 9 => 'Sep', 10 => 'Dec', 11 => 'Dec', 12 => 'Dec', ]; $timeFormat = sprintf('%s %s', $quarterEndings[$month], date('Y') ); return new \DateTime($timeFormat); } var_dump(getQuarterEndingOf(11));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SRuDr
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'getquarterendingof'
          2        SEND_VAL                                                 11
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function getquarterendingof:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SRuDr
function name:  getQuarterEndingOf
number of ops:  17
compiled vars:  !0 = $month, !1 = $quarterEndings, !2 = $timeFormat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
   12     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%25s+%25s'
   13     4        FETCH_DIM_R                                      ~4      !1, !0
          5        SEND_VAL                                                 ~4
   14     6        INIT_FCALL                                               'date'
          7        SEND_VAL                                                 'Y'
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
   12    11        ASSIGN                                                   !2, $6
   17    12        NEW                                              $8      'DateTime'
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0          
         15      > RETURN                                                   $8
   18    16*     > RETURN                                                   null

End of function getquarterendingof

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.96 ms | 1398 KiB | 20 Q