3v4l.org

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

End of function my_func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.01 ms | 1389 KiB | 21 Q