3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.76 ms | 1395 KiB | 15 Q