3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{} class Bar { private $type = 'Foo'; public function baz($item) { var_dump($item instanceof $this->type); } } $bar = new Bar(); $bar->baz(true); $foo = new Foo(); $bar->baz($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XUesB
function name:  (null)
number of ops:  13
compiled vars:  !0 = $bar, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        INIT_METHOD_CALL                                         !0, 'baz'
          4        SEND_VAL_EX                                              <true>
          5        DO_FCALL                                      0          
   14     6        NEW                                              $6      'Foo'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   15     9        INIT_METHOD_CALL                                         !0, 'baz'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XUesB
function name:  baz
number of ops:  8
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_dump'
          2        FETCH_OBJ_R                                      ~1      'type'
          3        FETCH_CLASS                                   0  $2      ~1
          4        INSTANCEOF                                       ~3      !0, $2
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                                 
    9     7      > RETURN                                                   null

End of function baz

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.71 ms | 1395 KiB | 15 Q