3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = ["date: march 27, 2017", "start: 12:30pm"]; foreach ($strings as $i => $string) { for ($i = 0; $i < 6; ++$i) { printf( "%d: %s BECOMES %s\n", $i, match($i) { 0 => ($pos = strpos($string, ": ")) ? substr($string, $pos + 2) : $string, 1 => ($sub = strstr($string, ": ")) ? substr($sub, 2) : $string, 2 => explode(': ', $string, 2)[1], 3 => array_slice(explode(': ', $string, 2), -1)[0], 4 => preg_replace('/(^.*?:\s)/', '', $string), 5 => preg_match("/^.*?:\s\K.*/", $string, $m) ? $m[0]: $string }, $string ); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 73
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 73
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 6
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
7 jumps found. (Code = 195) Position 1 = 11, Position 2 = 21, Position 3 = 30, Position 4 = 38, Position 5 = 50, Position 6 = 54, Position 7 = 10
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 6
Branch analysis from position: 72
Branch analysis from position: 6
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 10
1 jumps found. (Code = 197) Position 1 = -2
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
filename:       /in/aLEVl
function name:  (null)
number of ops:  75
compiled vars:  !0 = $strings, !1 = $string, !2 = $i, !3 = $pos, !4 = $sub, !5 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1      > FE_RESET_R                                           $7      !0, ->73
          2    > > FE_FETCH_R                                           ~8      $7, !1, ->73
          3    >   ASSIGN                                                       !2, ~8
    5     4        ASSIGN                                                       !2, 0
          5      > JMP                                                          ->70
    6     6    >   INIT_FCALL                                                   'printf'
    7     7        SEND_VAL                                                     '%25d%3A+%25s+BECOMES+%25s%0A'
    8     8        SEND_VAR                                                     !2
    9     9      > MATCH                                                        !2, [ 0:->11, 1:->21, 2:->30, 3:->38, 4:->50, 5:->54, ], ->10
         10    > > MATCH_ERROR                                                  !2
   10    11    >   FRAMELESS_ICALL_2                strpos              ~12     !1, '%3A+'
         12        ASSIGN                                               ~13     !3, ~12
         13      > JMPZ                                                         ~13, ->18
         14    >   ADD                                                  ~14     !3, 2
         15        FRAMELESS_ICALL_2                substr              ~15     !1, ~14
         16        QM_ASSIGN                                            ~16     ~15
         17      > JMP                                                          ->19
         18    >   QM_ASSIGN                                            ~16     !1
         19    >   QM_ASSIGN                                            ~17     ~16
         20      > JMP                                                          ->66
   11    21    >   FRAMELESS_ICALL_2                strstr              ~18     !1, '%3A+'
         22        ASSIGN                                               ~19     !4, ~18
         23      > JMPZ                                                         ~19, ->27
         24    >   FRAMELESS_ICALL_2                substr              ~20     !4, 2
         25        QM_ASSIGN                                            ~21     ~20
         26      > JMP                                                          ->28
         27    >   QM_ASSIGN                                            ~21     !1
         28    >   QM_ASSIGN                                            ~17     ~21
         29      > JMP                                                          ->66
   12    30    >   INIT_FCALL                                                   'explode'
         31        SEND_VAL                                                     '%3A+'
         32        SEND_VAR                                                     !1
         33        SEND_VAL                                                     2
         34        DO_ICALL                                             $22     
         35        FETCH_DIM_R                                          ~23     $22, 1
         36        QM_ASSIGN                                            ~17     ~23
         37      > JMP                                                          ->66
   13    38    >   INIT_FCALL                                                   'array_slice'
         39        INIT_FCALL                                                   'explode'
         40        SEND_VAL                                                     '%3A+'
         41        SEND_VAR                                                     !1
         42        SEND_VAL                                                     2
         43        DO_ICALL                                             $24     
         44        SEND_VAR                                                     $24
         45        SEND_VAL                                                     -1
         46        DO_ICALL                                             $25     
         47        FETCH_DIM_R                                          ~26     $25, 0
         48        QM_ASSIGN                                            ~17     ~26
         49      > JMP                                                          ->66
   14    50    >   FRAMELESS_ICALL_3                preg_replace        ~27     '%2F%28%5E.%2A%3F%3A%5Cs%29%2F', ''
         51        OP_DATA                                                      !1
         52        QM_ASSIGN                                            ~17     ~27
         53      > JMP                                                          ->66
   15    54    >   INIT_FCALL                                                   'preg_match'
         55        SEND_VAL                                                     '%2F%5E.%2A%3F%3A%5Cs%5CK.%2A%2F'
         56        SEND_VAR                                                     !1
         57        SEND_REF                                                     !5
         58        DO_ICALL                                             $28     
         59      > JMPZ                                                         $28, ->63
         60    >   FETCH_DIM_R                                          ~29     !5, 0
         61        QM_ASSIGN                                            ~30     ~29
         62      > JMP                                                          ->64
         63    >   QM_ASSIGN                                            ~30     !1
         64    >   QM_ASSIGN                                            ~17     ~30
         65      > JMP                                                          ->66
         66    >   SEND_VAL                                                     ~17
   17    67        SEND_VAR                                                     !1
    6    68        DO_ICALL                                                     
    5    69        PRE_INC                                                      !2
         70    >   IS_SMALLER                                                   !2, 6
         71      > JMPNZ                                                        ~33, ->6
    4    72    > > JMP                                                          ->2
         73    >   FE_FREE                                                      $7
   20    74      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.95 ms | 1966 KiB | 17 Q