3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Bar { public function __construct($param1) {} } $reflection = new \ReflectionClass('Foo'); var_dump($reflection->newInstanceArgs(array())); var_dump($reflection->newInstanceArgs(array(1))); $reflectionB = new \ReflectionClass('Bar'); var_dump($reflectionB->newInstanceArgs(array())); var_dump($reflectionB->newInstanceArgs(array(1))); var_dump($reflectionB->newInstanceArgs(array(1,2)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fIkCS
function name:  (null)
number of ops:  39
compiled vars:  !0 = $reflection, !1 = $reflectionB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    9     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'newInstanceArgs'
          6        SEND_VAL_EX                                              <array>
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'newInstanceArgs'
         12        SEND_VAL_EX                                              <array>
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                                 
   12    16        NEW                                              $9      'ReflectionClass'
         17        SEND_VAL_EX                                              'Bar'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !1, $9
   13    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !1, 'newInstanceArgs'
         22        SEND_VAL_EX                                              <array>
         23        DO_FCALL                                      0  $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                                 
   14    26        INIT_FCALL                                               'var_dump'
         27        INIT_METHOD_CALL                                         !1, 'newInstanceArgs'
         28        SEND_VAL_EX                                              <array>
         29        DO_FCALL                                      0  $14     
         30        SEND_VAR                                                 $14
         31        DO_ICALL                                                 
   15    32        INIT_FCALL                                               'var_dump'
         33        INIT_METHOD_CALL                                         !1, 'newInstanceArgs'
         34        SEND_VAL_EX                                              <array>
         35        DO_FCALL                                      0  $16     
         36        SEND_VAR                                                 $16
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fIkCS
function name:  __construct
number of ops:  2
compiled vars:  !0 = $param1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.13 ms | 1400 KiB | 15 Q