3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function foo() { if (isset($this)) { echo '$this is defined ('; echo get_class($this); echo ")\n"; } else { echo "\$this is not defined.\n"; } } } // this will print '$this is defined (A)' $a = new A(); $a->foo(); // what does this print? A::foo();
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/VW0bc
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  17     1        NEW                                              $2      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $2
  18     4        INIT_METHOD_CALL                                         !0, 'foo'
         5        DO_FCALL                                      0          
  21     6        INIT_STATIC_METHOD_CALL                                  'A', 'foo'
         7        DO_FCALL                                      0          
         8      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
Jump found. Position 1 = 10
Branch analysis from position: 10
Jump found. Position 1 = -2
Branch analysis from position: 9
Jump found. Position 1 = -2
filename:       /in/VW0bc
function name:  foo
number of ops:  11
compiled vars:  !0 = $this
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   ISSET_ISEMPTY_VAR                           310378496  ~1      !0
         1      > JMPZ                                                     ~1, ->9
   7     2    >   ECHO                                                     '%24this+is+defined+%28'
   8     3        INIT_FCALL                                               'get_class'
         4        SEND_VAR                                                 !0
         5        DO_ICALL                                         $2      
         6        ECHO                                                     $2
   9     7        ECHO                                                     '%29%0A'
         8      > JMP                                                      ->10
  11     9    >   ECHO                                                     '%24this+is+not+defined.%0A'
  13    10    > > RETURN                                                   null

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 7.2.0