3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** @implements IteratorAggregate<DateTimeInterface> */ class MyDatePeriod extends DatePeriod implements IteratorAggregate { public function getIterator(): self { return $this; } } function getDatePeriod(string $period): DatePeriod { return new MyDatePeriod($period); } $datePeriod = getDatePeriod("R4/2012-07-01T00:00:00Z/P7D"); if ($datePeriod instanceof IteratorAggregate) { $datePeriod->getIterator(); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/Pf4Nb
function name:  (null)
number of ops:  10
compiled vars:  !0 = $datePeriod
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'mydateperiod', 'dateperiod'
   17     1        INIT_FCALL                                               'getdateperiod'
          2        SEND_VAL                                                 'R4%2F2012-07-01T00%3A00%3A00Z%2FP7D'
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
   18     5        INSTANCEOF                                               !0, 'IteratorAggregate'
          6      > JMPZ                                                     ~3, ->9
   19     7    >   INIT_METHOD_CALL                                         !0, 'getIterator'
          8        DO_FCALL                                      0          
   20     9    > > RETURN                                                   1

Function getdateperiod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pf4Nb
function name:  getDatePeriod
number of ops:  8
compiled vars:  !0 = $period
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        NEW                                              $1      'MyDatePeriod'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   15     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function getdateperiod

Class MyDatePeriod:
Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pf4Nb
function name:  getIterator
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~0      
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
    9     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getiterator

End of class MyDatePeriod.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.7 ms | 1012 KiB | 14 Q