3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function test(int $a, int $i = null): void { if ($i === NULL) print("error\n"); else var_dump($i); } test(1, null); test(2, 32); test(3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/utCc3
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 null
          3        DO_FCALL                                      0          
   14     4        INIT_FCALL                                               'test'
          5        SEND_VAL                                                 2
          6        SEND_VAL                                                 32
          7        DO_FCALL                                      0          
   15     8        INIT_FCALL                                               'test'
          9        SEND_VAL                                                 3
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/utCc3
function name:  test
number of ops:  10
compiled vars:  !0 = $a, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    7     2        TYPE_CHECK                                    2          !1
          3      > JMPZ                                                     ~2, ->6
    8     4    >   ECHO                                                     'error%0A'
    7     5      > JMP                                                      ->9
   10     6    >   INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   11     9    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.9 ms | 1004 KiB | 17 Q