3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass {} function f() { $c = new MyClass(); $s = 'MyClass'; if ($c instanceof $s) { echo "yes1\n"; } else { echo "no1\n"; } $s = 'My'; if ($c instanceof $s.'Class') { echo "yes2\n"; } else { echo "no2\n"; } } f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8aYFf
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'f'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
Branch analysis from position: 17
filename:       /in/8aYFf
function name:  f
number of ops:  19
compiled vars:  !0 = $c, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $2      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        ASSIGN                                                   !1, 'MyClass'
   10     4        FETCH_CLASS                                   0  $6      !1
          5        INSTANCEOF                                               !0, $6
          6      > JMPZ                                                     ~7, ->9
   11     7    >   ECHO                                                     'yes1%0A'
          8      > JMP                                                      ->10
   13     9    >   ECHO                                                     'no1%0A'
   16    10    >   ASSIGN                                                   !1, 'My'
   17    11        FETCH_CLASS                                   0  $9      !1
         12        INSTANCEOF                                       ~10     !0, $9
         13        CONCAT                                           ~11     ~10, 'Class'
         14      > JMPZ                                                     ~11, ->17
   18    15    >   ECHO                                                     'yes2%0A'
         16      > JMP                                                      ->18
   20    17    >   ECHO                                                     'no2%0A'
   22    18    > > RETURN                                                   null

End of function f

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.04 ms | 1399 KiB | 14 Q