3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct() { call_user_func([$this, 'test']); call_user_func([$this, 'self::test']); call_user_func([$this, 'static::test']); } function test() { echo "foo\n"; } } class Bar extends Foo { function __construct() { call_user_func([$this, 'test']); call_user_func([$this, 'self::test']); call_user_func([$this, 'parent::test']); call_user_func([$this, 'Foo::test']); call_user_func([$this, 'Bar::test']); echo "---\n"; parent::__construct(); } function test() { echo "bar\n"; } } new Bar;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RO7Rc
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $0      'Bar'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
   34     3      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RO7Rc
function name:  __construct
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       ~0      
          1        INIT_ARRAY                                       ~1      ~0
          2        ADD_ARRAY_ELEMENT                                ~1      'test'
          3        INIT_USER_CALL                                0          'call_user_func', ~1
          4        DO_FCALL                                      0          
    8     5        FETCH_THIS                                       ~3      
          6        INIT_ARRAY                                       ~4      ~3
          7        ADD_ARRAY_ELEMENT                                ~4      'self%3A%3Atest'
          8        INIT_USER_CALL                                0          'call_user_func', ~4
          9        DO_FCALL                                      0          
    9    10        FETCH_THIS                                       ~6      
         11        INIT_ARRAY                                       ~7      ~6
         12        ADD_ARRAY_ELEMENT                                ~7      'static%3A%3Atest'
         13        INIT_USER_CALL                                0          'call_user_func', ~7
         14        DO_FCALL                                      0          
   10    15      > RETURN                                                   null

End of function __construct

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

End of function test

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RO7Rc
function name:  __construct
number of ops:  29
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_THIS                                       ~0      
          1        INIT_ARRAY                                       ~1      ~0
          2        ADD_ARRAY_ELEMENT                                ~1      'test'
          3        INIT_USER_CALL                                0          'call_user_func', ~1
          4        DO_FCALL                                      0          
   20     5        FETCH_THIS                                       ~3      
          6        INIT_ARRAY                                       ~4      ~3
          7        ADD_ARRAY_ELEMENT                                ~4      'self%3A%3Atest'
          8        INIT_USER_CALL                                0          'call_user_func', ~4
          9        DO_FCALL                                      0          
   21    10        FETCH_THIS                                       ~6      
         11        INIT_ARRAY                                       ~7      ~6
         12        ADD_ARRAY_ELEMENT                                ~7      'parent%3A%3Atest'
         13        INIT_USER_CALL                                0          'call_user_func', ~7
         14        DO_FCALL                                      0          
   22    15        FETCH_THIS                                       ~9      
         16        INIT_ARRAY                                       ~10     ~9
         17        ADD_ARRAY_ELEMENT                                ~10     'Foo%3A%3Atest'
         18        INIT_USER_CALL                                0          'call_user_func', ~10
         19        DO_FCALL                                      0          
   23    20        FETCH_THIS                                       ~12     
         21        INIT_ARRAY                                       ~13     ~12
         22        ADD_ARRAY_ELEMENT                                ~13     'Bar%3A%3Atest'
         23        INIT_USER_CALL                                0          'call_user_func', ~13
         24        DO_FCALL                                      0          
   25    25        ECHO                                                     '---%0A'
   27    26        INIT_STATIC_METHOD_CALL                                  
         27        DO_FCALL                                      0          
   28    28      > RETURN                                                   null

End of function __construct

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

End of function test

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.37 ms | 1399 KiB | 13 Q