3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c = new \ReflectionClass(\DateTimeImmutable::class); $methods = array_map(function ($m) { return $m->getName() . '(' . implode(',', array_map(function ($p) { return $p->getType() . ' $' . $p->getName() . ($p->isOptional() ? ' = ' . var_export($p->getDefaultValue(), true) : ''); }, $m->getParameters())) . ')' . ($m->getReturnType() ? (': ' . $m->getReturnType()) : ''); }, $c->getMethods()); $properties = array_map(function ($m) { return $m->getName(); }, $c->getProperties()); var_dump($methods, $properties);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3TGg8
function name:  (null)
number of ops:  25
compiled vars:  !0 = $c, !1 = $methods, !2 = $properties
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              'DateTimeImmutable'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    5     4        INIT_FCALL                                               'array_map'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3TGg8%3A5%240'
   12     6        SEND_VAL                                                 ~6
          7        INIT_METHOD_CALL                                         !0, 'getMethods'
          8        DO_FCALL                                      0  $7      
          9        SEND_VAR                                                 $7
         10        DO_ICALL                                         $8      
    5    11        ASSIGN                                                   !1, $8
   14    12        INIT_FCALL                                               'array_map'
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3TGg8%3A14%242'
   16    14        SEND_VAL                                                 ~10
         15        INIT_METHOD_CALL                                         !0, 'getProperties'
         16        DO_FCALL                                      0  $11     
         17        SEND_VAR                                                 $11
         18        DO_ICALL                                         $12     
   14    19        ASSIGN                                                   !2, $12
   18    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !1
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3TGg8%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3TGg8
function name:  {closure}
number of ops:  29
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_METHOD_CALL                                         !0, 'getName'
          2        DO_FCALL                                      0  $1      
    7     3        CONCAT                                           ~2      $1, '%28'
          4        INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '%2C'
          6        INIT_FCALL                                               'array_map'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3TGg8%3A7%241'
   11     8        SEND_VAL                                                 ~3
          9        INIT_METHOD_CALL                                         !0, 'getParameters'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                         $6      
         15        CONCAT                                           ~7      ~2, $6
         16        CONCAT                                           ~8      ~7, '%29'
         17        INIT_METHOD_CALL                                         !0, 'getReturnType'
         18        DO_FCALL                                      0  $9      
         19      > JMPZ                                                     $9, ->25
         20    >   INIT_METHOD_CALL                                         !0, 'getReturnType'
         21        DO_FCALL                                      0  $10     
         22        CONCAT                                           ~11     '%3A+', $10
         23        QM_ASSIGN                                        ~12     ~11
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~12     ''
         26    >   CONCAT                                           ~13     ~8, ~12
         27      > RETURN                                                   ~13
   12    28*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3TGg8%3A5%240

Function %00%7Bclosure%7D%2Fin%2F3TGg8%3A7%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3TGg8
function name:  {closure}
number of ops:  23
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_METHOD_CALL                                         !0, 'getType'
          2        DO_FCALL                                      0  $1      
    9     3        CONCAT                                           ~2      $1, '+%24'
          4        INIT_METHOD_CALL                                         !0, 'getName'
          5        DO_FCALL                                      0  $3      
          6        CONCAT                                           ~4      ~2, $3
   10     7        INIT_METHOD_CALL                                         !0, 'isOptional'
          8        DO_FCALL                                      0  $5      
          9      > JMPZ                                                     $5, ->19
         10    >   INIT_FCALL                                               'var_export'
         11        INIT_METHOD_CALL                                         !0, 'getDefaultValue'
         12        DO_FCALL                                      0  $6      
         13        SEND_VAR                                                 $6
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $7      
         16        CONCAT                                           ~8      '+%3D+', $7
         17        QM_ASSIGN                                        ~9      ~8
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~9      ''
         20    >   CONCAT                                           ~10     ~4, ~9
         21      > RETURN                                                   ~10
   11    22*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3TGg8%3A7%241

Function %00%7Bclosure%7D%2Fin%2F3TGg8%3A14%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3TGg8
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_METHOD_CALL                                         !0, 'getName'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   16     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3TGg8%3A14%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.92 ms | 1409 KiB | 21 Q