3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DateTimeFactory { const DATE_INTERVAL = 'PT20M'; public static function createDateTimeByInterval(DateInterval $dateInterval) { // create DateTime, add Date and/or TimeZone if needed. $dateTime = new DateTime(); return $dateTime->add($dateInterval); } } var_dump(DateTimeFactory::createDateTimeByInterval(new DateInterval(DateTimeFactory::DATE_INTERVAL)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5XX2F
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'DateTimeFactory', 'createDateTimeByInterval'
          2        NEW                                              $0      'DateInterval'
          3        SEND_VAL_EX                                              'PT20M'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class DateTimeFactory:
Function createdatetimebyinterval:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5XX2F
function name:  createDateTimeByInterval
number of ops:  9
compiled vars:  !0 = $dateInterval, !1 = $dateTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
   10     1        NEW                                              $2      'DateTime'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
   11     4        INIT_METHOD_CALL                                         !1, 'add'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $5      
          7      > RETURN                                                   $5
   12     8*     > RETURN                                                   null

End of function createdatetimebyinterval

End of class DateTimeFactory.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
202.05 ms | 1399 KiB | 15 Q