3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "01001010101101111011101001010100010101101010101010101101101010010110110110"; $n = 10; for($a=$b=$c=0;(($d=@substr_count($s,1,$a,$n))>$c&&(($b=$a)&&($c=$d)))||$a<strlen($s);$a++);echo $b;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 6
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
Branch analysis from position: 23
Branch analysis from position: 27
Branch analysis from position: 22
Branch analysis from position: 23
filename:       /in/J4vqa
function name:  (null)
number of ops:  30
compiled vars:  !0 = $s, !1 = $n, !2 = $a, !3 = $b, !4 = $c, !5 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '01001010101101111011101001010100010101101010101010101101101010010110110110'
    4     1        ASSIGN                                                   !1, 10
    6     2        ASSIGN                                           ~8      !4, 0
          3        ASSIGN                                           ~9      !3, ~8
          4        ASSIGN                                                   !2, ~9
          5      > JMP                                                      ->7
          6    >   PRE_INC                                                  !2
          7    >   BEGIN_SILENCE                                    ~12     
          8        INIT_FCALL                                               'substr_count'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 1
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $13     
         14        END_SILENCE                                              ~12
         15        ASSIGN                                           ~14     !5, $13
         16        IS_SMALLER                                       ~15     !4, ~14
         17      > JMPZ_EX                                          ~15     ~15, ->23
         18    >   ASSIGN                                           ~16     !3, !2
         19      > JMPZ_EX                                          ~16     ~16, ->22
         20    >   ASSIGN                                           ~17     !4, !5
         21        BOOL                                             ~16     ~17
         22    >   BOOL                                             ~15     ~16
         23    > > JMPNZ_EX                                         ~15     ~15, ->27
         24    >   STRLEN                                           ~18     !0
         25        IS_SMALLER                                       ~19     !2, ~18
         26        BOOL                                             ~15     ~19
         27    > > JMPNZ                                                    ~15, ->6
         28    >   ECHO                                                     !3
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.54 ms | 1396 KiB | 15 Q