3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo() { if (isset($this)) { echo "A->foo()\n"; } else { echo "A::foo()\n"; } } } A::foo(); $a = new A(); $a->foo(); $a::foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LUZrP
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'foo'
          1        DO_FCALL                                      0          
   15     2        NEW                                              $2      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   16     5        INIT_METHOD_CALL                                         !0, 'foo'
          6        DO_FCALL                                      0          
   17     7        FETCH_CLASS                                   0  $6      !0
          8        INIT_STATIC_METHOD_CALL                                  $6, 'foo'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LUZrP
function name:  foo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ISSET_ISEMPTY_THIS                               ~0      
          1      > JMPZ                                                     ~0, ->4
    5     2    >   ECHO                                                     'A-%3Efoo%28%29%0A'
          3      > JMP                                                      ->5
    8     4    >   ECHO                                                     'A%3A%3Afoo%28%29%0A'
   10     5    > > RETURN                                                   null

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.93 ms | 1393 KiB | 13 Q