3v4l.org

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

Function fdopen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cfH7l
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:
153.15 ms | 1388 KiB | 15 Q