3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); function wantString(string $s): void {}; $str = 'foo'; wantString($str); static function() use(&$str): void { $str = 42; }; wantString($str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3aFL4
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, 'foo'
    7     1        INIT_FCALL                                                   'wantstring'
          2        SEND_VAR                                                     !0
          3        DO_FCALL                                          0          
    9     4        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          5        BIND_LEXICAL                                                 ~3, !0
   11     6        FREE                                                         ~3
   13     7        INIT_FCALL                                                   'wantstring'
          8        SEND_VAR                                                     !0
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3aFL4
function name:  {closure:/in/3aFL4:9}
number of ops:  3
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                                  !0
   10     1        ASSIGN                                                       !0, 42
   11     2      > RETURN                                                       null

End of Dynamic Function 0

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

End of function wantstring

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.11 ms | 2301 KiB | 15 Q