3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Document { // Standard type public string $companyTitleStandard; // Union types public DocumentFieldCompanyTitle|string $companyTitleUnion; } $rp = new ReflectionProperty(Document::class, 'companyTitleUnion'); $unionTypes = array_map(function($type) { return $type->getName(); }, $rp->getType()->getTypes()); var_dump($unionTypes);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SlbXX
function name:  (null)
number of ops:  19
compiled vars:  !0 = $rp, !1 = $unionTypes
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $2      'ReflectionProperty'
          1        SEND_VAL_EX                                                  'Document'
          2        SEND_VAL_EX                                                  'companyTitleUnion'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $2
   16     5        INIT_FCALL                                                   'array_map'
          6        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
   18     7        SEND_VAL                                                     ~5
          8        INIT_METHOD_CALL                                             !0, 'getType'
          9        DO_FCALL                                          0  $6      
         10        INIT_METHOD_CALL                                             $6, 'getTypes'
         11        DO_FCALL                                          0  $7      
         12        SEND_VAR                                                     $7
   16    13        DO_ICALL                                             $8      
         14        ASSIGN                                                       !1, $8
   20    15        INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !1
         17        DO_ICALL                                                     
         18      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SlbXX
function name:  {closure:/in/SlbXX:16}
number of ops:  5
compiled vars:  !0 = $type
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
   17     1        INIT_METHOD_CALL                                             !0, 'getName'
          2        DO_FCALL                                          0  $1      
          3      > RETURN                                                       $1
   18     4*     > RETURN                                                       null

End of Dynamic Function 0

Class Document: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.13 ms | 1486 KiB | 15 Q