3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface MakeMeCMS_Listener_interface { public function __construct($method, $args); public function setFeedback($arg, $type); public function feedback(); } class MakeMeCMS_Listener implements MakeMeCMS_Listener_interface { private $_feedback; private $_type; public function __construct($method, $args) { if(method_exists($this, $method)) { if($args != '') { if(preg_match('#\,#', $args)) { $args = explode(',', $args); } $this->$method($args); } else { $this->$method(); } } } public function setFeedback($arg,$type) { $this->_feedback = $arg; $this->_type = $type; } public function feedback() { return $this->_feedback; } private function test(array $args) { $string = ''; foreach($args as $arg) { $string .= $arg.' '; } $this->setFeedback($string, 'text/plain'); } } class myAddon_Listener extends MakeMeCMS_Listener implements MakeMeCMS_Listener_interface { public function __construct($method, $args) { if(method_exists($this, $method)) { if($args != '') { if(preg_match('#\,#', $args)) { $args = explode(',', $args); } $this->$method($args); } else { $this->$method(); } } } public function setFeedback($arg, $type) { parent::setFeedback($arg, $type); } public function feedback() { return parent::_feedback; } private function test2() { echo('Hello World!'); } } $listener = new MakeMeCMS_Listener('test', 'foo,bar'); echo($listener->feedback()); $customListener = new myAddon_Listener('test2'); echo($customListener->feedback());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  (null)
number of ops:  18
compiled vars:  !0 = $listener, !1 = $customListener
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'makemecms_listener'
   38     1        DECLARE_CLASS                                            'myaddon_listener', 'makemecms_listener'
   62     2        NEW                                              $2      'MakeMeCMS_Listener'
          3        SEND_VAL_EX                                              'test'
          4        SEND_VAL_EX                                              'foo%2Cbar'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   63     7        INIT_METHOD_CALL                                         !0, 'feedback'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
   64    10        NEW                                              $6      'myAddon_Listener'
         11        SEND_VAL_EX                                              'test2'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $6
   65    14        INIT_METHOD_CALL                                         !1, 'feedback'
         15        DO_FCALL                                      0  $9      
         16        ECHO                                                     $9
         17      > RETURN                                                   1

Class MakeMeCMS_Listener_interface:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  __construct
number of ops:  3
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function __construct

Function setfeedback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  setFeedback
number of ops:  3
compiled vars:  !0 = $arg, !1 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function setfeedback

Function feedback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  feedback
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function feedback

End of class MakeMeCMS_Listener_interface.

Class MakeMeCMS_Listener:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/h0obG
function name:  __construct
number of ops:  27
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        INIT_FCALL                                               'method_exists'
          3        FETCH_THIS                                       ~2      
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->26
   12     8    >   IS_NOT_EQUAL                                             !1, ''
          9      > JMPZ                                                     ~4, ->24
   13    10    >   INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%23%5C%2C%23'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $5      
         14      > JMPZ                                                     $5, ->20
   14    15    >   INIT_FCALL                                               'explode'
         16        SEND_VAL                                                 '%2C'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $6      
         19        ASSIGN                                                   !1, $6
   16    20    >   INIT_METHOD_CALL                                         !0
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0          
         23      > JMP                                                      ->26
   19    24    >   INIT_METHOD_CALL                                         !0
         25        DO_FCALL                                      0          
   22    26    > > RETURN                                                   null

End of function __construct

Function setfeedback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  setFeedback
number of ops:  7
compiled vars:  !0 = $arg, !1 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        ASSIGN_OBJ                                               '_feedback'
          3        OP_DATA                                                  !0
   25     4        ASSIGN_OBJ                                               '_type'
          5        OP_DATA                                                  !1
   26     6      > RETURN                                                   null

End of function setfeedback

Function feedback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  feedback
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   FETCH_OBJ_R                                      ~0      '_feedback'
          1      > RETURN                                                   ~0
   29     2*     > RETURN                                                   null

End of function feedback

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/h0obG
function name:  test
number of ops:  13
compiled vars:  !0 = $args, !1 = $string, !2 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   31     1        ASSIGN                                                   !1, ''
   32     2      > FE_RESET_R                                       $4      !0, ->7
          3    > > FE_FETCH_R                                               $4, !2, ->7
   33     4    >   CONCAT                                           ~5      !2, '+'
          5        ASSIGN_OP                                     8          !1, ~5
   32     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $4
   35     8        INIT_METHOD_CALL                                         'setFeedback'
          9        SEND_VAR_EX                                              !1
         10        SEND_VAL_EX                                              'text%2Fplain'
         11        DO_FCALL                                      0          
   36    12      > RETURN                                                   null

End of function test

End of class MakeMeCMS_Listener.

Class myAddon_Listener:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/h0obG
function name:  __construct
number of ops:  27
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   40     2        INIT_FCALL                                               'method_exists'
          3        FETCH_THIS                                       ~2      
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->26
   41     8    >   IS_NOT_EQUAL                                             !1, ''
          9      > JMPZ                                                     ~4, ->24
   42    10    >   INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%23%5C%2C%23'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $5      
         14      > JMPZ                                                     $5, ->20
   43    15    >   INIT_FCALL                                               'explode'
         16        SEND_VAL                                                 '%2C'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $6      
         19        ASSIGN                                                   !1, $6
   45    20    >   INIT_METHOD_CALL                                         !0
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0          
         23      > JMP                                                      ->26
   48    24    >   INIT_METHOD_CALL                                         !0
         25        DO_FCALL                                      0          
   51    26    > > RETURN                                                   null

End of function __construct

Function setfeedback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  setFeedback
number of ops:  7
compiled vars:  !0 = $arg, !1 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   53     2        INIT_STATIC_METHOD_CALL                                  'setFeedback'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   54     6      > RETURN                                                   null

End of function setfeedback

Function feedback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  feedback
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   FETCH_CLASS_CONSTANT                             ~0      '_feedback'
          1      > RETURN                                                   ~0
   57     2*     > RETURN                                                   null

End of function feedback

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h0obG
function name:  test2
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   ECHO                                                     'Hello+World%21'
   60     1      > RETURN                                                   null

End of function test2

End of class myAddon_Listener.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.07 ms | 1408 KiB | 19 Q