3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fwrite_with_retry($sock, &$data) { $bytes_to_write = strlen($data); $bytes_written = 0; while ( $bytes_written < $bytes_to_write ) { if ( $bytes_written == 0 ) { $rv = fwrite($sock, $data); } else { $rv = fwrite($sock, substr($data, $bytes_written)); } if ( $rv === false || $rv == 0 ) return( $bytes_written == 0 ? false : $bytes_written ); $bytes_written += $rv; } return $bytes_written; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/17OMC
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   1

Function fwrite_with_retry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 6
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 34
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 6
Branch analysis from position: 37
Branch analysis from position: 6
Branch analysis from position: 27
Branch analysis from position: 14
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Branch analysis from position: 27
filename:       /in/17OMC
function name:  fwrite_with_retry
number of ops:  39
compiled vars:  !0 = $sock, !1 = $data, !2 = $bytes_to_write, !3 = $bytes_written, !4 = $rv
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        STRLEN                                           ~5      !1
          3        ASSIGN                                                   !2, ~5
    5     4        ASSIGN                                                   !3, 0
    7     5      > JMP                                                      ->35
    9     6    >   IS_EQUAL                                                 !3, 0
          7      > JMPZ                                                     ~8, ->14
   10     8    >   INIT_FCALL                                               'fwrite'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !4, $9
         13      > JMP                                                      ->23
   12    14    >   INIT_FCALL                                               'fwrite'
         15        SEND_VAR                                                 !0
         16        INIT_FCALL                                               'substr'
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !4, $12
   15    23    >   TYPE_CHECK                                    4  ~14     !4
         24      > JMPNZ_EX                                         ~14     ~14, ->27
         25    >   IS_EQUAL                                         ~15     !4, 0
         26        BOOL                                             ~14     ~15
         27    > > JMPZ                                                     ~14, ->34
   16    28    >   IS_EQUAL                                                 !3, 0
         29      > JMPZ                                                     ~16, ->32
         30    >   QM_ASSIGN                                        ~17     <false>
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~17     !3
         33    > > RETURN                                                   ~17
   18    34    >   ASSIGN_OP                                     1          !3, !4
    7    35    >   IS_SMALLER                                               !3, !2
         36      > JMPNZ                                                    ~19, ->6
   21    37    > > RETURN                                                   !3
   22    38*     > RETURN                                                   null

End of function fwrite_with_retry

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.25 ms | 1400 KiB | 17 Q