3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($s){ for( $i = $j = 0, $n = count( $s ) - 1; $j <= $n; ){ ( $s[$j] < 0 && ( ($x = $s[$i]) | ($s[$i] = $s[$j]) | ($s[$j] = $x) | $i++ | $j++ ) ) || ( $s[$j] && ( ($x = $s[$i]) | ($s[$i] = $s[$j]) | ($s[$j] = $x) | $n-- ) ) || $j++; } echo implode(',',$s); } echo "-------------\n"; f( [5, 3, 0, -6, 2, 0, 5] ); echo "-------------\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HnISG
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     '-------------%0A'
   12     1        INIT_FCALL                                               'f'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0          
   13     4        ECHO                                                     '-------------%0A'
          5      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 7
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 40
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 27, Position 2 = 39
Branch analysis from position: 27
2 jumps found. (Code = 47) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 7
Branch analysis from position: 45
Branch analysis from position: 7
Branch analysis from position: 43
Branch analysis from position: 39
Branch analysis from position: 40
Branch analysis from position: 24
filename:       /in/HnISG
function name:  f
number of ops:  51
compiled vars:  !0 = $s, !1 = $i, !2 = $j, !3 = $n, !4 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                           ~5      !2, 0
          2        ASSIGN                                                   !1, ~5
          3        COUNT                                            ~7      !0
          4        SUB                                              ~8      ~7, 1
          5        ASSIGN                                                   !3, ~8
          6      > JMP                                                      ->43
    5     7    >   FETCH_DIM_R                                      ~10     !0, !2
          8        IS_SMALLER                                       ~11     ~10, 0
          9      > JMPZ_EX                                          ~11     ~11, ->24
         10    >   FETCH_DIM_R                                      ~12     !0, !1
         11        ASSIGN                                           ~13     !4, ~12
         12        FETCH_DIM_R                                      ~15     !0, !2
         13        ASSIGN_DIM                                       ~14     !0, !1
         14        OP_DATA                                                  ~15
         15        BW_OR                                            ~16     ~13, ~14
         16        ASSIGN_DIM                                       ~17     !0, !2
         17        OP_DATA                                                  !4
         18        BW_OR                                            ~18     ~16, ~17
         19        POST_INC                                         ~19     !1
         20        BW_OR                                            ~20     ~18, ~19
         21        POST_INC                                         ~21     !2
         22        BW_OR                                            ~22     ~20, ~21
         23        BOOL                                             ~11     ~22
         24    > > JMPNZ_EX                                         ~11     ~11, ->40
    6    25    >   FETCH_DIM_R                                      ~23     !0, !2
         26      > JMPZ_EX                                          ~23     ~23, ->39
         27    >   FETCH_DIM_R                                      ~24     !0, !1
         28        ASSIGN                                           ~25     !4, ~24
         29        FETCH_DIM_R                                      ~27     !0, !2
         30        ASSIGN_DIM                                       ~26     !0, !1
         31        OP_DATA                                                  ~27
         32        BW_OR                                            ~28     ~25, ~26
         33        ASSIGN_DIM                                       ~29     !0, !2
         34        OP_DATA                                                  !4
         35        BW_OR                                            ~30     ~28, ~29
         36        POST_DEC                                         ~31     !3
         37        BW_OR                                            ~32     ~30, ~31
         38        BOOL                                             ~23     ~32
         39    >   BOOL                                             ~11     ~23
         40    > > JMPNZ_EX                                         ~11     ~11, ->43
         41    >   POST_INC                                         ~33     !2
         42        BOOL                                             ~11     ~33
    4    43    >   IS_SMALLER_OR_EQUAL                                      !2, !3
         44      > JMPNZ                                                    ~34, ->7
    8    45    >   INIT_FCALL                                               'implode'
         46        SEND_VAL                                                 '%2C'
         47        SEND_VAR                                                 !0
         48        DO_ICALL                                         $35     
         49        ECHO                                                     $35
    9    50      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.86 ms | 1407 KiB | 16 Q