3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function test($a) { $c = __CLASS__; return $a instanceof $c; } } var_dump(A::test(new A())); var_dump(A::test(new stdClass));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FlFlk
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'A', 'test'
          2        NEW                                              $0      'A'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'var_dump'
          9        INIT_STATIC_METHOD_CALL                                  'A', 'test'
         10        NEW                                              $4      'stdClass'
         11        DO_FCALL                                      0          
         12        SEND_VAR                                                 $4
         13        DO_FCALL                                      0  $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FlFlk
function name:  test
number of ops:  6
compiled vars:  !0 = $a, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        ASSIGN                                                   !1, 'A'
          2        FETCH_CLASS                                   0  $3      !1
          3        INSTANCEOF                                       ~4      !0, $3
          4      > RETURN                                                   ~4
          5*     > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.49 ms | 1395 KiB | 15 Q