3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lines = array( "0123333333", "asdfasfasdf", "01234555555" ); foreach($lines as $line){ $len = strlen($line); if(($len==10||$len==11)&&"0123"===substr($line, 0, 4)) echo "valid: $line \n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 23
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 22
Branch analysis from position: 17
Branch analysis from position: 9
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/tLH7B
function name:  (null)
number of ops:  25
compiled vars:  !0 = $lines, !1 = $line, !2 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $4      !0, ->23
          2    > > FE_FETCH_R                                               $4, !1, ->23
   10     3    >   STRLEN                                           ~5      !1
          4        ASSIGN                                                   !2, ~5
   11     5        IS_EQUAL                                         ~7      !2, 10
          6      > JMPNZ_EX                                         ~7      ~7, ->9
          7    >   IS_EQUAL                                         ~8      !2, 11
          8        BOOL                                             ~7      ~8
          9    > > JMPZ_EX                                          ~7      ~7, ->17
         10    >   INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 4
         14        DO_ICALL                                         $9      
         15        IS_IDENTICAL                                     ~10     $9, '0123'
         16        BOOL                                             ~7      ~10
         17    > > JMPZ                                                     ~7, ->22
   12    18    >   ROPE_INIT                                     3  ~12     'valid%3A+'
         19        ROPE_ADD                                      1  ~12     ~12, !1
         20        ROPE_END                                      2  ~11     ~12, '+%0A'
         21        ECHO                                                     ~11
    9    22    > > JMP                                                      ->2
         23    >   FE_FREE                                                  $4
   13    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
268.52 ms | 1011 KiB | 14 Q