3v4l.org

run code in 500+ PHP versions simultaneously
<?php print get_class($c = new class() {}); //class@anonymousphp-wasm run script:3$0 $d = new class() {}; var_dump($c instanceof $d); // false! interface i {} $e = new class() implements i {}; var_dump($e instanceof i); // true function foo() { return new class() {}; } $x = foo(); var_dump(foo() instanceof $x); // syntax error ! // var_dump($x instanceof foo()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C93Ug
function name:  (null)
number of ops:  34
compiled vars:  !0 = $c, !1 = $d, !2 = $e, !3 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                                   <true>  
          1        NEW                                                  $5      $4
          2        DO_FCALL                                          0          
          3        ASSIGN                                               ~7      !0, $5
          4        GET_CLASS                                            ~8      ~7
          5        ECHO                                                         ~8
    5     6        DECLARE_ANON_CLASS                                   <unknown> 
          7        NEW                                                  $10     $9
          8        DO_FCALL                                          0          
          9        ASSIGN                                                       !1, $10
    7    10        INIT_FCALL                                                   'var_dump'
         11        FETCH_CLASS                                       0  $13     !1
         12        INSTANCEOF                                           ~14     !0, $13
         13        SEND_VAL                                                     ~14
         14        DO_ICALL                                                     
   12    15        DECLARE_ANON_CLASS                                   <unknown> 
         16        NEW                                                  $17     $16
         17        DO_FCALL                                          0          
         18        ASSIGN                                                       !2, $17
   13    19        INIT_FCALL                                                   'var_dump'
         20        INSTANCEOF                                           ~20     !2, 'i'
         21        SEND_VAL                                                     ~20
         22        DO_ICALL                                                     
   19    23        INIT_FCALL                                                   'foo'
         24        DO_FCALL                                          0  $22     
         25        ASSIGN                                                       !3, $22
   20    26        INIT_FCALL                                                   'var_dump'
         27        INIT_FCALL                                                   'foo'
         28        DO_FCALL                                          0  $24     
         29        FETCH_CLASS                                       0  $25     !3
         30        INSTANCEOF                                           ~26     $24, $25
         31        SEND_VAL                                                     ~26
         32        DO_ICALL                                                     
   24    33      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C93Ug
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   DECLARE_ANON_CLASS                                   <unknown> 
          1        NEW                                                  $1      $0
          2        DO_FCALL                                          0          
          3      > RETURN                                                       $1
   18     4*     > RETURN                                                       null

End of function foo

Class class@anonymous: [no user functions]
Class class@anonymous: [no user functions]
Class i: [no user functions]
Class i@anonymous: [no user functions]
Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
132.98 ms | 1479 KiB | 16 Q