3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { public function foo() { echo "hi"; } } class Bar { use Foo; } $b = new Bar; $b->foo(); var_dump($b instanceof Bar); var_dump($b instanceof Foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TIPSm
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'bar'
   10     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   12     4        INIT_METHOD_CALL                                         !0, 'foo'
          5        DO_FCALL                                      0          
   14     6        INIT_FCALL                                               'var_dump'
          7        INSTANCEOF                                       ~5      !0, 'Bar'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   16    10        INIT_FCALL                                               'var_dump'
         11        INSTANCEOF                                       ~7      !0, 'Foo'
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TIPSm
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'hi'
          1      > RETURN                                                   null

End of function foo

End of class Foo.

Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.16 ms | 1395 KiB | 15 Q