3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fdopen($id, $mode) { return fopen("/proc/self/fd/".(int)$id, $mode); } for ($i = 1; $i <= 10; $i++) { echo fdopen($i,'r'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
Branch analysis from position: 2
filename:       /in/kmvmu
function name:  (null)
number of ops:  11
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->8
    8     2    >   INIT_FCALL                                               'fdopen'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'r'
          5        DO_FCALL                                      0  $2      
          6        ECHO                                                     $2
    7     7        PRE_INC                                                  !0
          8    >   IS_SMALLER_OR_EQUAL                                      !0, 10
          9      > JMPNZ                                                    ~4, ->2
    9    10    > > RETURN                                                   1

Function fdopen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kmvmu
function name:  fdopen
number of ops:  10
compiled vars:  !0 = $id, !1 = $mode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'fopen'
          3        CAST                                          4  ~2      !0
          4        CONCAT                                           ~3      '%2Fproc%2Fself%2Ffd%2F', ~2
          5        SEND_VAL                                                 ~3
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
    5     9*     > RETURN                                                   null

End of function fdopen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.34 ms | 1398 KiB | 16 Q