3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public function test() { $this->testPrivate(); $this->privatefoo(); } private function testPrivate() { echo "Bar::testPrivate\n"; } } class Foo extends Bar { private function testPrivate() { echo "Foo::testPrivate\n"; } private function privatefoo(){ echo "Foo::privatefoo"; } public function testFooScope() { $this->testPrivate(); } } class Zot extends Foo { } $myZot = new Zot(); $myZot->test(); //What would this do other than Bar::testPrivate $myZot->testFooScope();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  (null)
number of ops:  8
compiled vars:  !0 = $myZot
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   NEW                                              $1      'Zot'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   42     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
   44     5        INIT_METHOD_CALL                                         !0, 'testFooScope'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Bar:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'testPrivate'
          1        DO_FCALL                                      0          
    8     2        INIT_METHOD_CALL                                         'privatefoo'
          3        DO_FCALL                                      0          
    9     4      > RETURN                                                   null

End of function test

Function testprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  testPrivate
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'Bar%3A%3AtestPrivate%0A'
   14     1      > RETURN                                                   null

End of function testprivate

End of class Bar.

Class Foo:
Function testprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  testPrivate
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'Foo%3A%3AtestPrivate%0A'
   22     1      > RETURN                                                   null

End of function testprivate

Function privatefoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  privatefoo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ECHO                                                     'Foo%3A%3Aprivatefoo'
   27     1      > RETURN                                                   null

End of function privatefoo

Function testfooscope:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  testFooScope
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_METHOD_CALL                                         'testPrivate'
          1        DO_FCALL                                      0          
   33     2      > RETURN                                                   null

End of function testfooscope

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'testPrivate'
          1        DO_FCALL                                      0          
    8     2        INIT_METHOD_CALL                                         'privatefoo'
          3        DO_FCALL                                      0          
    9     4      > RETURN                                                   null

End of function test

End of class Foo.

Class Zot:
Function testprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  testPrivate
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'Foo%3A%3AtestPrivate%0A'
   22     1      > RETURN                                                   null

End of function testprivate

Function privatefoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  privatefoo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ECHO                                                     'Foo%3A%3Aprivatefoo'
   27     1      > RETURN                                                   null

End of function privatefoo

Function testfooscope:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  testFooScope
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_METHOD_CALL                                         'testPrivate'
          1        DO_FCALL                                      0          
   33     2      > RETURN                                                   null

End of function testfooscope

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z8jYe
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'testPrivate'
          1        DO_FCALL                                      0          
    8     2        INIT_METHOD_CALL                                         'privatefoo'
          3        DO_FCALL                                      0          
    9     4      > RETURN                                                   null

End of function test

End of class Zot.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.18 ms | 1403 KiB | 13 Q