3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ function foo() { if(isset($this)) { return true; } return false; } function bar() { return $this; } } class B{ function bb() { $a = new A(); var_dump(A::bar()); var_dump($a->bar()); } } $a = new A; var_dump(A::foo()); var_dump($a->foo()); $b = new B(); $b->bb();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ishL
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        INIT_FCALL                                               'var_dump'
          4        INIT_STATIC_METHOD_CALL                                  'A', 'foo'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                                 
   28     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'foo'
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
   30    13        NEW                                              $9      'B'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $9
   31    16        INIT_METHOD_CALL                                         !1, 'bb'
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ishL
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ISSET_ISEMPTY_THIS                               ~0      
          1      > JMPZ                                                     ~0, ->3
    7     2    > > RETURN                                                   <true>
    9     3    > > RETURN                                                   <false>
   11     4*     > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ishL
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
   15     2*     > RETURN                                                   null

End of function bar

End of class A.

Class B:
Function bb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ishL
function name:  bb
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_FCALL                                               'var_dump'
          4        INIT_STATIC_METHOD_CALL                                  'A', 'bar'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   22     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'bar'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
   23    13      > RETURN                                                   null

End of function bb

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.8 ms | 1400 KiB | 15 Q