3v4l.org

run code in 300+ PHP versions simultaneously
<?php $DAY = 1; class Days{ function __construct($d){ $this->day = $d ; } function addToDate(){ global $DAY; $this->day = $this->day + $DAY; return $this->day; } function modifyDay($d){ $DAY = $d; } } $p = new Days(5); echo $p->addToDate(); $p->modifyDay(8); echo $p->addToDate();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bm5n9
function name:  (null)
number of ops:  15
compiled vars:  !0 = $DAY, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
   16     1        NEW                                              $3      'Days'
          2        SEND_VAL_EX                                              5
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   17     5        INIT_METHOD_CALL                                         !1, 'addToDate'
          6        DO_FCALL                                      0  $6      
          7        ECHO                                                     $6
   18     8        INIT_METHOD_CALL                                         !1, 'modifyDay'
          9        SEND_VAL_EX                                              8
         10        DO_FCALL                                      0          
   19    11        INIT_METHOD_CALL                                         !1, 'addToDate'
         12        DO_FCALL                                      0  $8      
         13        ECHO                                                     $8
         14      > RETURN                                                   1

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

End of function __construct

Function addtodate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bm5n9
function name:  addToDate
number of ops:  8
compiled vars:  !0 = $DAY
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_GLOBAL                                              !0, 'DAY'
    9     1        FETCH_OBJ_R                                      ~2      'day'
          2        ADD                                              ~3      ~2, !0
          3        ASSIGN_OBJ                                               'day'
          4        OP_DATA                                                  ~3
   10     5        FETCH_OBJ_R                                      ~4      'day'
          6      > RETURN                                                   ~4
   11     7*     > RETURN                                                   null

End of function addtodate

Function modifyday:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bm5n9
function name:  modifyDay
number of ops:  3
compiled vars:  !0 = $d, !1 = $DAY
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        ASSIGN                                                   !1, !0
          2      > RETURN                                                   null

End of function modifyday

End of class Days.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.53 ms | 1399 KiB | 13 Q