3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); function acceptsNull(?string $x): void{} function doesNotAcceptNull(string $x): void{} acceptsNull(null); // all ok doesNotAcceptNull(null); // boom!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u5UPN
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'acceptsnull'
          1        SEND_VAL                                                     null
          2        DO_FCALL                                          0          
   14     3        INIT_FCALL                                                   'doesnotacceptnull'
          4        SEND_VAL                                                     null
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

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

End of function acceptsnull

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

End of function doesnotacceptnull

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
181.23 ms | 924 KiB | 10 Q