3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function test(string $value); } abstract class Fan implements Foo { abstract public function test(string $value); public function otherTest(string $value) { var_dump(__METHOD__, $value); } } class Bar extends Fan implements Foo { public function test(string $value) { var_dump(__METHOD__, $value); } } class Baz extends Bar {} class Bop extends Bar { public function test(string $value) { var_dump(__METHOD__, $value); } } class Fin extends Fan { public function test(string $value) { var_dump(__METHOD__, $value); } } $bar = new Bar(); $baz = new Baz(); $bop = new Bop(); $fin = new Fin(); $bar->test('bar'); $bar->otherTest('bar'); $bar->test('baz'); $bar->otherTest('bar'); $bop->test('bop'); $bop->otherTest('bop'); $fin->test('fan'); $fin->otherTest('fan');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMLGv
function name:  (null)
number of ops:  42
compiled vars:  !0 = $bar, !1 = $baz, !2 = $bop, !3 = $fin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'fan'
   15     1        DECLARE_CLASS                                            'bar', 'fan'
   21     2        DECLARE_CLASS                                            'baz', 'bar'
   23     3        DECLARE_CLASS                                            'bop', 'bar'
   29     4        DECLARE_CLASS                                            'fin', 'fan'
   35     5        NEW                                              $4      'Bar'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $4
   36     8        NEW                                              $7      'Baz'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
   37    11        NEW                                              $10     'Bop'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $10
   38    14        NEW                                              $13     'Fin'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !3, $13
   40    17        INIT_METHOD_CALL                                         !0, 'test'
         18        SEND_VAL_EX                                              'bar'
         19        DO_FCALL                                      0          
   41    20        INIT_METHOD_CALL                                         !0, 'otherTest'
         21        SEND_VAL_EX                                              'bar'
         22        DO_FCALL                                      0          
   42    23        INIT_METHOD_CALL                                         !0, 'test'
         24        SEND_VAL_EX                                              'baz'
         25        DO_FCALL                                      0          
   43    26        INIT_METHOD_CALL                                         !0, 'otherTest'
         27        SEND_VAL_EX                                              'bar'
         28        DO_FCALL                                      0          
   44    29        INIT_METHOD_CALL                                         !2, 'test'
         30        SEND_VAL_EX                                              'bop'
         31        DO_FCALL                                      0          
   45    32        INIT_METHOD_CALL                                         !2, 'otherTest'
         33        SEND_VAL_EX                                              'bop'
         34        DO_FCALL                                      0          
   46    35        INIT_METHOD_CALL                                         !3, 'test'
         36        SEND_VAL_EX                                              'fan'
         37        DO_FCALL                                      0          
   47    38        INIT_METHOD_CALL                                         !3, 'otherTest'
         39        SEND_VAL_EX                                              'fan'
         40        DO_FCALL                                      0          
         41      > RETURN                                                   1

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

End of function test

End of class Foo.

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

End of function test

Function othertest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMLGv
function name:  otherTest
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Fan%3A%3AotherTest'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   12     5      > RETURN                                                   null

End of function othertest

End of class Fan.

Class Bar:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMLGv
function name:  test
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Bar%3A%3Atest'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   18     5      > RETURN                                                   null

End of function test

End of class Bar.

Class Baz: [no user functions]
Class Bop:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMLGv
function name:  test
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Bop%3A%3Atest'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   26     5      > RETURN                                                   null

End of function test

End of class Bop.

Class Fin:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMLGv
function name:  test
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   31     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Fin%3A%3Atest'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   32     5      > RETURN                                                   null

End of function test

End of class Fin.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.37 ms | 1404 KiB | 15 Q