3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Demo { public function __construct(DateTimeInterface $dateTime) { $this->date = $dateTime; } public function getDateTime(): DateTimeInterface { return $this->date; } public function echo() { echo $this->date->format("d/m/Y h:i:s"); } } $demo = new Demo(new DateTime()); $demo->echo()."\n"; $demo->getDateTime()->add(new DateInterval('P1D')); $demo->echo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp2X
function name:  (null)
number of ops:  21
compiled vars:  !0 = $demo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Demo'
          1        NEW                                              $2      'DateTime'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   12     6        INIT_METHOD_CALL                                         !0, 'echo'
          7        DO_FCALL                                      0  $6      
          8        CONCAT                                           ~7      $6, '%0A'
          9        FREE                                                     ~7
   13    10        INIT_METHOD_CALL                                         !0, 'getDateTime'
         11        DO_FCALL                                      0  $8      
         12        INIT_METHOD_CALL                                         $8, 'add'
         13        NEW                                              $9      'DateInterval'
         14        SEND_VAL_EX                                              'P1D'
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $9
         17        DO_FCALL                                      0          
   14    18        INIT_METHOD_CALL                                         !0, 'echo'
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Class Demo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp2X
function name:  __construct
number of ops:  4
compiled vars:  !0 = $dateTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               'date'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function __construct

Function getdatetime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp2X
function name:  getDateTime
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'date'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
          3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getdatetime

Function echo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp2X
function name:  echo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'date'
          1        INIT_METHOD_CALL                                         ~0, 'format'
          2        SEND_VAL_EX                                              'd%2Fm%2FY+h%3Ai%3As'
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
          5      > RETURN                                                   null

End of function echo

End of class Demo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.35 ms | 1399 KiB | 13 Q