3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public static function f($c) { $c->m(); return $c; } } class B { public function g($c) { $ret=A::f($c); if($ret===false) { echo "Should never print this\n"; } } } class C { public function m() { return false; } } $b = new B(); $b->g(new C());
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/hRn1Q
function name:  (null)
number of ops:  12
compiled vars:  !0 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP                                                      
  13     1        NOP                                                      
  25     2        NOP                                                      
  33     3        NEW                                              $4      :-6
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $4
  34     6        INIT_METHOD_CALL                                         !0, 'g'
         7        NEW                                              $7      :-2
         8        DO_FCALL                                      0          
         9        SEND_VAR_NO_REF                               0          $7
        10        DO_FCALL                                      0          
        11      > RETURN                                                   1

Class A:
Function f:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/hRn1Q
function name:  f
number of ops:  5
compiled vars:  !0 = $c
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   RECV                                             !0      
   8     1        INIT_METHOD_CALL                                         !0, 'm'
         2        DO_FCALL                                      0          
   9     3      > RETURN                                                   !0
  10     4*     > RETURN                                                   null

End of function f

End of class A.

Class B:
Function g:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
Jump found. Position 1 = -2
Branch analysis from position: 8
filename:       /in/hRn1Q
function name:  g
number of ops:  9
compiled vars:  !0 = $c, !1 = $ret
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   RECV                                             !0      
  17     1        INIT_STATIC_METHOD_CALL                                  'A', 'f'
         2        SEND_VAR_EX                                              !0
         3        DO_FCALL                                      0  $2      
         4        ASSIGN                                                   !1, $2
  18     5        IS_IDENTICAL                                     ~4      !1, <false>
         6      > JMPZ                                                     ~4, ->8
  20     7    >   ECHO                                                     'Should+never+print+this%0A'
  22     8    > > RETURN                                                   null

End of function g

End of class B.

Class C:
Function m:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/hRn1Q
function name:  m
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  29     0  E > > RETURN                                                   <false>
  30     1*     > RETURN                                                   null

End of function m

End of class C.

Generated using Vulcan Logic Dumper, using php 7.1.0