3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UserDefinedClass{} class DynamicObject{} $ud_obj = new UserDefinedClass(); $do_obj = new DynamicObject(); $sc_obj = new stdClass(); $a_obj = (object)array(); echo "===[get_class()]===\n"; printf( "UserDefinedClass Object Class: %s\n", get_class($ud_obj)); printf( "DynamicObject Object Class: %s\n", get_class($do_obj)); printf( "StdClass Object Class: %s\n", get_class($sc_obj)); printf( "Array-derived Object Class: %s\n", get_class($a_obj)); echo "\n===[gettype()]===\n"; printf( "UserDefinedClass Object Type: %s\n", gettype($ud_obj)); printf( "DynamicObject Object Type: %s\n", gettype($do_obj)); printf( "StdClass Object Type: %s\n", gettype($sc_obj)); printf( "Array-derived Object Type: %s\n", gettype($a_obj)); echo "\n===[is_a(stdClass::class)]===\n"; printf( "UserDefinedClass Object Type: %s\n", is_a($ud_obj,stdClass::class)); printf( "DynamicObject Object Type: %s\n", is_a($do_obj,stdClass::class)); printf( "StdClass Object Type: %s\n", is_a($sc_obj,stdClass::class)); printf( "Array-derived Object Type: %s\n", is_a($a_obj,stdClass::class)); echo "\n===[instanceof stdClass]===\n"; printf( "UserDefinedClass Object Type: %s\n", $ud_obj instanceof stdClass); printf( "DynamicObject Object Type: %s\n", $do_obj instanceof stdClass); printf( "StdClass Object Type: %s\n", $sc_obj instanceof stdClass); printf( "Array-derived Object Type: %s\n", $a_obj instanceof stdClass); echo "\n===[is_a(DynamicObject::class)]===\n"; printf( "UserDefinedClass Object Type: %s\n", is_a($ud_obj,DynamicObject::class)); printf( "DynamicObject Object Type: %s\n", is_a($do_obj,DynamicObject::class)); printf( "DynamicObject Object Type: %s\n", is_a($sc_obj,DynamicObject::class)); printf( "Array-derived Object Type: %s\n", is_a($a_obj,DynamicObject::class)); echo "\n===[instanceof DynamicObject]===\n"; printf( "UserDefinedClass Object Type: %s\n", $ud_obj instanceof DynamicObject); printf( "DynamicObject Object Type: %s\n", $do_obj instanceof DynamicObject); printf( "DynamicObject Object Type: %s\n", $sc_obj instanceof DynamicObject); printf( "Array-derived Object Type: %s\n", $a_obj instanceof DynamicObject); echo "\n===[is_subclass_of(stdClass::class)]===\n"; printf( "UserDefinedClass Object Type: %s\n", is_subclass_of($ud_obj,stdClass::class)); printf( "DynamicObject Object Type: %s\n", is_subclass_of($do_obj,stdClass::class)); printf( "StdClass Object Type: %s\n", is_subclass_of($sc_obj,stdClass::class)); printf( "Array-derived Object Type: %s\n", is_subclass_of($a_obj,stdClass::class));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDlOn
function name:  (null)
number of ops:  195
compiled vars:  !0 = $ud_obj, !1 = $do_obj, !2 = $sc_obj, !3 = $a_obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $4      'UserDefinedClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    8     3        NEW                                              $7      'DynamicObject'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $7
    9     6        NEW                                              $10     'stdClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $10
   10     9        CAST                                          8  ~13     <array>
         10        ASSIGN                                                   !3, ~13
   12    11        ECHO                                                     '%3D%3D%3D%5Bget_class%28%29%5D%3D%3D%3D%0A'
   13    12        INIT_FCALL                                               'printf'
         13        SEND_VAL                                                 'UserDefinedClass+Object+Class%3A+%25s%0A'
         14        GET_CLASS                                        ~15     !0
         15        SEND_VAL                                                 ~15
         16        DO_ICALL                                                 
   14    17        INIT_FCALL                                               'printf'
         18        SEND_VAL                                                 'DynamicObject+Object+Class%3A++++%25s%0A'
         19        GET_CLASS                                        ~17     !1
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                                 
   15    22        INIT_FCALL                                               'printf'
         23        SEND_VAL                                                 'StdClass+Object+Class%3A+++++++++%25s%0A'
         24        GET_CLASS                                        ~19     !2
         25        SEND_VAL                                                 ~19
         26        DO_ICALL                                                 
   16    27        INIT_FCALL                                               'printf'
         28        SEND_VAL                                                 'Array-derived+Object+Class%3A++++%25s%0A'
         29        GET_CLASS                                        ~21     !3
         30        SEND_VAL                                                 ~21
         31        DO_ICALL                                                 
   18    32        ECHO                                                     '%0A%3D%3D%3D%5Bgettype%28%29%5D%3D%3D%3D%0A'
   19    33        INIT_FCALL                                               'printf'
         34        SEND_VAL                                                 'UserDefinedClass+Object+Type%3A++%25s%0A'
         35        GET_TYPE                                         ~23     !0
         36        SEND_VAL                                                 ~23
         37        DO_ICALL                                                 
   20    38        INIT_FCALL                                               'printf'
         39        SEND_VAL                                                 'DynamicObject+Object+Type%3A+++++%25s%0A'
         40        GET_TYPE                                         ~25     !1
         41        SEND_VAL                                                 ~25
         42        DO_ICALL                                                 
   21    43        INIT_FCALL                                               'printf'
         44        SEND_VAL                                                 'StdClass+Object+Type%3A++++++++++%25s%0A'
         45        GET_TYPE                                         ~27     !2
         46        SEND_VAL                                                 ~27
         47        DO_ICALL                                                 
   22    48        INIT_FCALL                                               'printf'
         49        SEND_VAL                                                 'Array-derived+Object+Type%3A+++++%25s%0A'
         50        GET_TYPE                                         ~29     !3
         51        SEND_VAL                                                 ~29
         52        DO_ICALL                                                 
   25    53        ECHO                                                     '%0A%3D%3D%3D%5Bis_a%28stdClass%3A%3Aclass%29%5D%3D%3D%3D%0A'
   26    54        INIT_FCALL                                               'printf'
         55        SEND_VAL                                                 'UserDefinedClass+Object+Type%3A++%25s%0A'
         56        INIT_FCALL                                               'is_a'
         57        SEND_VAR                                                 !0
         58        SEND_VAL                                                 'stdClass'
         59        DO_ICALL                                         $31     
         60        SEND_VAR                                                 $31
         61        DO_ICALL                                                 
   27    62        INIT_FCALL                                               'printf'
         63        SEND_VAL                                                 'DynamicObject+Object+Type%3A+++++%25s%0A'
         64        INIT_FCALL                                               'is_a'
         65        SEND_VAR                                                 !1
         66        SEND_VAL                                                 'stdClass'
         67        DO_ICALL                                         $33     
         68        SEND_VAR                                                 $33
         69        DO_ICALL                                                 
   28    70        INIT_FCALL                                               'printf'
         71        SEND_VAL                                                 'StdClass+Object+Type%3A++++++++++%25s%0A'
         72        INIT_FCALL                                               'is_a'
         73        SEND_VAR                                                 !2
         74        SEND_VAL                                                 'stdClass'
         75        DO_ICALL                                         $35     
         76        SEND_VAR                                                 $35
         77        DO_ICALL                                                 
   29    78        INIT_FCALL                                               'printf'
         79        SEND_VAL                                                 'Array-derived+Object+Type%3A+++++%25s%0A'
         80        INIT_FCALL                                               'is_a'
         81        SEND_VAR                                                 !3
         82        SEND_VAL                                                 'stdClass'
         83        DO_ICALL                                         $37     
         84        SEND_VAR                                                 $37
         85        DO_ICALL                                                 
   32    86        ECHO                                                     '%0A%3D%3D%3D%5Binstanceof+stdClass%5D%3D%3D%3D%0A'
   33    87        INIT_FCALL                                               'printf'
         88        SEND_VAL                                                 'UserDefinedClass+Object+Type%3A++%25s%0A'
         89        INSTANCEOF                                       ~39     !0, 'stdClass'
         90        SEND_VAL                                                 ~39
         91        DO_ICALL                                                 
   34    92        INIT_FCALL                                               'printf'
         93        SEND_VAL                                                 'DynamicObject+Object+Type%3A+++++%25s%0A'
         94        INSTANCEOF                                       ~41     !1, 'stdClass'
         95        SEND_VAL                                                 ~41
         96        DO_ICALL                                                 
   35    97        INIT_FCALL                                               'printf'
         98        SEND_VAL                                                 'StdClass+Object+Type%3A++++++++++%25s%0A'
         99        INSTANCEOF                                       ~43     !2, 'stdClass'
        100        SEND_VAL                                                 ~43
        101        DO_ICALL                                                 
   36   102        INIT_FCALL                                               'printf'
        103        SEND_VAL                                                 'Array-derived+Object+Type%3A+++++%25s%0A'
        104        INSTANCEOF                                       ~45     !3, 'stdClass'
        105        SEND_VAL                                                 ~45
        106        DO_ICALL                                                 
   38   107        ECHO                                                     '%0A%3D%3D%3D%5Bis_a%28DynamicObject%3A%3Aclass%29%5D%3D%3D%3D%0A'
   39   108        INIT_FCALL                                               'printf'
        109        SEND_VAL                                                 'UserDefinedClass+Object+Type%3A++%25s%0A'
        110        INIT_FCALL                                               'is_a'
        111        SEND_VAR                                                 !0
        112        SEND_VAL                                                 'DynamicObject'
        113        DO_ICALL                                         $47     
        114        SEND_VAR                                                 $47
        115        DO_ICALL                                                 
   40   116        INIT_FCALL                                               'printf'
        117        SEND_VAL                                                 'DynamicObject+Object+Type%3A+++++%25s%0A'
        118        INIT_FCALL                                               'is_a'
        119        SEND_VAR                                                 !1
        120        SEND_VAL                                                 'DynamicObject'
        121        DO_ICALL                                         $49     
        122        SEND_VAR                                                 $49
        123        DO_ICALL                                                 
   41   124        INIT_FCALL                                               'printf'
        125        SEND_VAL                                                 'DynamicObject+Object+Type%3A++++++++++%25s%0A'
        126        INIT_FCALL                                               'is_a'
        127        SEND_VAR                                                 !2
        128        SEND_VAL                                                 'DynamicObject'
        129        DO_ICALL                                         $51     
        130        SEND_VAR                                                 $51
        131        DO_ICALL                                                 
   42   132        INIT_FCALL                                               'printf'
        133        SEND_VAL                                                 'Array-derived+Object+Type%3A+++++%25s%0A'
        134        INIT_FCALL                                               'is_a'
        135        SEND_VAR                                                 !3
        136        SEND_VAL                                                 'DynamicObject'
        137        DO_ICALL                                         $53     
        138        SEND_VAR                                                 $53
        139        DO_ICALL                                                 
   45   140        ECHO                                                     '%0A%3D%3D%3D%5Binstanceof+DynamicObject%5D%3D%3D%3D%0A'
   46   141        INIT_FCALL                                               'printf'
        142        SEND_VAL                                                 'UserDefinedClass+Object+Type%3A++%25s%0A'
        143        INSTANCEOF                                       ~55     !0, 'DynamicObject'
        144        SEND_VAL                                                 ~55
        145        DO_ICALL                                                 
   47   146        INIT_FCALL                                               'printf'
        147        SEND_VAL                                                 'DynamicObject+Object+Type%3A+++++%25s%0A'
        148        INSTANCEOF                                       ~57     !1, 'DynamicObject'
        149        SEND_VAL                                                 ~57
        150        DO_ICALL                                                 
   48   151        INIT_FCALL                                               'printf'
        152        SEND_VAL                                                 'DynamicObject+Object+Type%3A++++++++++%25s%0A'
        153        INSTANCEOF                                       ~59     !2, 'DynamicObject'
        154        SEND_VAL                                                 ~59
        155        DO_ICALL                                                 
   49   156        INIT_FCALL                                               'printf'
        157        SEND_VAL                                                 'Array-derived+Object+Type%3A+++++%25s%0A'
        158        INSTANCEOF                                       ~61     !3, 'DynamicObject'
        159        SEND_VAL                                                 ~61
        160        DO_ICALL                                                 
   52   161        ECHO                                                     '%0A%3D%3D%3D%5Bis_subclass_of%28stdClass%3A%3Aclass%29%5D%3D%3D%3D%0A'
   53   162        INIT_FCALL                                               'printf'
        163        SEND_VAL                                                 'UserDefinedClass+Object+Type%3A++%25s%0A'
        164        INIT_FCALL                                               'is_subclass_of'
        165        SEND_VAR                                                 !0
        166        SEND_VAL                                                 'stdClass'
        167        DO_ICALL                                         $63     
        168        SEND_VAR                                                 $63
        169        DO_ICALL                                                 
   54   170        INIT_FCALL                                               'printf'
        171        SEND_VAL                                                 'DynamicObject+Object+Type%3A+++++%25s%0A'
        172        INIT_FCALL                                               'is_subclass_of'
        173        SEND_VAR                                                 !1
        174        SEND_VAL                                                 'stdClass'
        175        DO_ICALL                                         $65     
        176        SEND_VAR                                                 $65
        177        DO_ICALL                                                 
   55   178        INIT_FCALL                                               'printf'
        179        SEND_VAL                                                 'StdClass+Object+Type%3A++++++++++%25s%0A'
        180        INIT_FCALL                                               'is_subclass_of'
        181        SEND_VAR                                                 !2
        182        SEND_VAL                                                 'stdClass'
        183        DO_ICALL                                         $67     
        184        SEND_VAR                                                 $67
        185        DO_ICALL                                                 
   56   186        INIT_FCALL                                               'printf'
        187        SEND_VAL                                                 'Array-derived+Object+Type%3A+++++%25s%0A'
        188        INIT_FCALL                                               'is_subclass_of'
        189        SEND_VAR                                                 !3
        190        SEND_VAL                                                 'stdClass'
        191        DO_ICALL                                         $69     
        192        SEND_VAR                                                 $69
        193        DO_ICALL                                                 
        194      > RETURN                                                   1

Class UserDefinedClass: [no user functions]
Class DynamicObject: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.59 ms | 1019 KiB | 16 Q