3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = ['This is. a. test.', 'This is a........... test.', 'This is. a test', 'This is a test', 'This. is... a. test.' ]; foreach ($strings as $string) { if (($offset = strpos($string, '...')) !== false) { echo "Yes, found 3 in a row ($string -> $offset)"; } else { echo "Nope, no occurrence of 3 dots in a row ($string)"; } echo "\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 = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/1u2Nu
function name:  (null)
number of ops:  25
compiled vars:  !0 = $strings, !1 = $string, !2 = $offset
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    >   INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 '...'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                           ~6      !2, $5
          8        TYPE_CHECK                                  1018          ~6
          9      > JMPZ                                                     ~7, ->17
   11    10    >   ROPE_INIT                                     5  ~9      'Yes%2C+found+3+in+a+row+%28'
         11        ROPE_ADD                                      1  ~9      ~9, !1
         12        ROPE_ADD                                      2  ~9      ~9, '+-%3E+'
         13        ROPE_ADD                                      3  ~9      ~9, !2
         14        ROPE_END                                      4  ~8      ~9, '%29'
         15        ECHO                                                     ~8
   10    16      > JMP                                                      ->21
   13    17    >   ROPE_INIT                                     3  ~13     'Nope%2C+no+occurrence+of+3+dots+in+a+row+%28'
         18        ROPE_ADD                                      1  ~13     ~13, !1
         19        ROPE_END                                      2  ~12     ~13, '%29'
         20        ECHO                                                     ~12
   15    21    >   ECHO                                                     '%0A'
    9    22      > JMP                                                      ->2
         23    >   FE_FREE                                                  $4
   16    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.49 ms | 1001 KiB | 14 Q