3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_func(int $n) { var_dump($n); } my_func('6'); // => (int) 6 my_func(3.1415); // => (int) 3 my_func(TRUE); // => (int) 1 my_func(new \stdClass()); // => Fatal error: Uncaught TypeError: Argument 1 passed to my_func() must be of the type integer, array given my_func([]); // => Fatal error: Uncaught TypeError: Argument 1 passed to my_func() must be of the type integer, array given my_func(NULL); // => ... null given
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IjpG3
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'my_func'
          1        SEND_VAL                                                 '6'
          2        DO_FCALL                                      0          
    5     3        INIT_FCALL                                               'my_func'
          4        SEND_VAL                                                 3.1415
          5        DO_FCALL                                      0          
    6     6        INIT_FCALL                                               'my_func'
          7        SEND_VAL                                                 <true>
          8        DO_FCALL                                      0          
    7     9        INIT_FCALL                                               'my_func'
         10        NEW                                              $3      'stdClass'
         11        DO_FCALL                                      0          
         12        SEND_VAR                                                 $3
         13        DO_FCALL                                      0          
    8    14        INIT_FCALL                                               'my_func'
         15        SEND_VAL                                                 <array>
         16        DO_FCALL                                      0          
    9    17        INIT_FCALL                                               'my_func'
         18        SEND_VAL                                                 null
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Function my_func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IjpG3
function name:  my_func
number of ops:  5
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function my_func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.75 ms | 1402 KiB | 21 Q