3v4l.org

run code in 300+ PHP versions simultaneously
<?php function v($v) { $len=strlen($v); for($i=0,$s='';$i<$len;$i++) { if($v[$i]=='1'){$s.=$v[$i];} } return $s; } echo v(123456781); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EaDDo
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'v'
          1        SEND_VAL                                                 123456781
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   14     4      > RETURN                                                   1

Function v:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
Branch analysis from position: 11
filename:       /in/EaDDo
function name:  v
number of ops:  16
compiled vars:  !0 = $v, !1 = $len, !2 = $i, !3 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        STRLEN                                           ~4      !0
          2        ASSIGN                                                   !1, ~4
    5     3        ASSIGN                                                   !2, 0
          4        ASSIGN                                                   !3, ''
          5      > JMP                                                      ->12
    7     6    >   FETCH_DIM_R                                      ~8      !0, !2
          7        IS_EQUAL                                                 ~8, '1'
          8      > JMPZ                                                     ~9, ->11
          9    >   FETCH_DIM_R                                      ~10     !0, !2
         10        ASSIGN_OP                                     8          !3, ~10
    5    11    >   PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, !1
         13      > JMPNZ                                                    ~13, ->6
    9    14    > > RETURN                                                   !3
   10    15*     > RETURN                                                   null

End of function v

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.13 ms | 1398 KiB | 14 Q