3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { private $val = 1; public function getVal() { return $this->val; } } trait MyTrait { public function cry() { echo "nya"; } } interface MyInterface { public function say(); } function check($class_name) { echo "================ ", $class_name, "\n"; $h = new \ReflectionClass($class_name); echo "abstract? ", $h->isAbstract() ? "true" : "false" , "\n"; echo "trait? ", $h->isTrait() ? "true" : "false" , "\n"; echo "interface? ", $h->isInterface() ? "true" : "false" , "\n"; echo "実体化可能? ", $h->isInstantiable() ? "true" : "false" , "\n"; } check("MyClass"); check("MyTrait"); check("MyInterface");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sAEeA
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_FCALL                                               'check'
          1        SEND_VAL                                                 'MyClass'
          2        DO_FCALL                                      0          
   33     3        INIT_FCALL                                               'check'
          4        SEND_VAL                                                 'MyTrait'
          5        DO_FCALL                                      0          
   34     6        INIT_FCALL                                               'check'
          7        SEND_VAL                                                 'MyInterface'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
Branch analysis from position: 41
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
Branch analysis from position: 32
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
Branch analysis from position: 23
filename:       /in/sAEeA
function name:  check
number of ops:  45
compiled vars:  !0 = $class_name, !1 = $h
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        ECHO                                                     '%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D+'
          2        ECHO                                                     !0
          3        ECHO                                                     '%0A'
   25     4        NEW                                              $2      'ReflectionClass'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $2
   26     8        ECHO                                                     'abstract%3F+'
          9        INIT_METHOD_CALL                                         !1, 'isAbstract'
         10        DO_FCALL                                      0  $5      
         11      > JMPZ                                                     $5, ->14
         12    >   QM_ASSIGN                                        ~6      'true'
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~6      'false'
         15    >   ECHO                                                     ~6
         16        ECHO                                                     '%0A'
   27    17        ECHO                                                     'trait%3F+'
         18        INIT_METHOD_CALL                                         !1, 'isTrait'
         19        DO_FCALL                                      0  $7      
         20      > JMPZ                                                     $7, ->23
         21    >   QM_ASSIGN                                        ~8      'true'
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~8      'false'
         24    >   ECHO                                                     ~8
         25        ECHO                                                     '%0A'
   28    26        ECHO                                                     'interface%3F+'
         27        INIT_METHOD_CALL                                         !1, 'isInterface'
         28        DO_FCALL                                      0  $9      
         29      > JMPZ                                                     $9, ->32
         30    >   QM_ASSIGN                                        ~10     'true'
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~10     'false'
         33    >   ECHO                                                     ~10
         34        ECHO                                                     '%0A'
   29    35        ECHO                                                     '%E5%AE%9F%E4%BD%93%E5%8C%96%E5%8F%AF%E8%83%BD%3F+'
         36        INIT_METHOD_CALL                                         !1, 'isInstantiable'
         37        DO_FCALL                                      0  $11     
         38      > JMPZ                                                     $11, ->41
         39    >   QM_ASSIGN                                        ~12     'true'
         40      > JMP                                                      ->42
         41    >   QM_ASSIGN                                        ~12     'false'
         42    >   ECHO                                                     ~12
         43        ECHO                                                     '%0A'
   30    44      > RETURN                                                   null

End of function check

Class MyClass:
Function getval:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sAEeA
function name:  getVal
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'val'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getval

End of class MyClass.

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

End of function cry

End of class MyTrait.

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

End of function say

End of class MyInterface.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.38 ms | 1407 KiB | 16 Q