3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Dynamic { function __call($name, $arguments); } class Foo { public function sing() { var_dump('Do re mi!'); } public function dance() { var_dump('Cha cha cha!'); } } class Bar implements Dynamic { public function __call($name, $arguments) { // @todo; magic } } function gimmeFoo(Foo $foo) { $foo->sing(); $foo->dance(); } gimmeFoo(new Bar()); // works because Dynamic dodges typechecks
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MOTfr
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   DECLARE_CLASS                                            'bar'
   35     1        INIT_FCALL                                               'gimmefoo'
          2        NEW                                              $0      'Bar'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function gimmefoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MOTfr
function name:  gimmeFoo
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        INIT_METHOD_CALL                                         !0, 'sing'
          2        DO_FCALL                                      0          
   32     3        INIT_METHOD_CALL                                         !0, 'dance'
          4        DO_FCALL                                      0          
   33     5      > RETURN                                                   null

End of function gimmefoo

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

End of function __call

End of class Dynamic.

Class Foo:
Function sing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MOTfr
function name:  sing
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Do+re+mi%21'
          2        DO_ICALL                                                 
   13     3      > RETURN                                                   null

End of function sing

Function dance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MOTfr
function name:  dance
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Cha+cha+cha%21'
          2        DO_ICALL                                                 
   18     3      > RETURN                                                   null

End of function dance

End of class Foo.

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

End of function __call

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.43 ms | 1407 KiB | 16 Q