3v4l.org

run code in 300+ PHP versions simultaneously
<?php class WithCast { public function __construct(bool $bool) { } } var_dump((new ReflectionClass(WithCast::class))->newInstanceArgs(['no a bool'])); class WithoutCast { public function __construct(float $float) { } } var_dump((new ReflectionClass(WithoutCast::class))->newInstanceArgs(['no a float']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GYr0T
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'ReflectionClass'
          2        SEND_VAL_EX                                              'WithCast'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'newInstanceArgs'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   17     9        INIT_FCALL                                               'var_dump'
         10        NEW                                              $4      'ReflectionClass'
         11        SEND_VAL_EX                                              'WithoutCast'
         12        DO_FCALL                                      0          
         13        INIT_METHOD_CALL                                         $4, 'newInstanceArgs'
         14        SEND_VAL_EX                                              <array>
         15        DO_FCALL                                      0  $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function __construct

End of class WithCast.

Class WithoutCast:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GYr0T
function name:  __construct
number of ops:  2
compiled vars:  !0 = $float
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1      > RETURN                                                   null

End of function __construct

End of class WithoutCast.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.66 ms | 1401 KiB | 15 Q