3v4l.org

run code in 300+ 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 = 88
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 88
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 6
Branch analysis from position: 87
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 = 27, Position 3 = 42, Position 4 = 50, Position 5 = 62, Position 6 = 69, Position 7 = 10
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 6
Branch analysis from position: 87
Branch analysis from position: 6
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 78
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 10
1 jumps found. (Code = 197) Position 1 = -2
Branch analysis from position: 88
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 88
filename:       /in/aLEVl
function name:  (null)
number of ops:  90
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, ->88
          2    > > FE_FETCH_R                                       ~8      $7, !1, ->88
          3    >   ASSIGN                                                   !2, ~8
    5     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->85
    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:->27, 2:->42, 3:->50, 4:->62, 5:->69, ], ->10
         10    > > MATCH_ERROR                                              !2
   10    11    >   INIT_FCALL                                               'strpos'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 '%3A+'
         14        DO_ICALL                                         $12     
         15        ASSIGN                                           ~13     !3, $12
         16      > JMPZ                                                     ~13, ->24
         17    >   INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !1
         19        ADD                                              ~14     !3, 2
         20        SEND_VAL                                                 ~14
         21        DO_ICALL                                         $15     
         22        QM_ASSIGN                                        ~16     $15
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~16     !1
         25    >   QM_ASSIGN                                        ~17     ~16
         26      > JMP                                                      ->81
   11    27    >   INIT_FCALL                                               'strstr'
         28        SEND_VAR                                                 !1
         29        SEND_VAL                                                 '%3A+'
         30        DO_ICALL                                         $18     
         31        ASSIGN                                           ~19     !4, $18
         32      > JMPZ                                                     ~19, ->39
         33    >   INIT_FCALL                                               'substr'
         34        SEND_VAR                                                 !4
         35        SEND_VAL                                                 2
         36        DO_ICALL                                         $20     
         37        QM_ASSIGN                                        ~21     $20
         38      > JMP                                                      ->40
         39    >   QM_ASSIGN                                        ~21     !1
         40    >   QM_ASSIGN                                        ~17     ~21
         41      > JMP                                                      ->81
   12    42    >   INIT_FCALL                                               'explode'
         43        SEND_VAL                                                 '%3A+'
         44        SEND_VAR                                                 !1
         45        SEND_VAL                                                 2
         46        DO_ICALL                                         $22     
         47        FETCH_DIM_R                                      ~23     $22, 1
         48        QM_ASSIGN                                        ~17     ~23
         49      > JMP                                                      ->81
   13    50    >   INIT_FCALL                                               'array_slice'
         51        INIT_FCALL                                               'explode'
         52        SEND_VAL                                                 '%3A+'
         53        SEND_VAR                                                 !1
         54        SEND_VAL                                                 2
         55        DO_ICALL                                         $24     
         56        SEND_VAR                                                 $24
         57        SEND_VAL                                                 -1
         58        DO_ICALL                                         $25     
         59        FETCH_DIM_R                                      ~26     $25, 0
         60        QM_ASSIGN                                        ~17     ~26
         61      > JMP                                                      ->81
   14    62    >   INIT_FCALL                                               'preg_replace'
         63        SEND_VAL                                                 '%2F%28%5E.%2A%3F%3A%5Cs%29%2F'
         64        SEND_VAL                                                 ''
         65        SEND_VAR                                                 !1
         66        DO_ICALL                                         $27     
         67        QM_ASSIGN                                        ~17     $27
         68      > JMP                                                      ->81
   15    69    >   INIT_FCALL                                               'preg_match'
         70        SEND_VAL                                                 '%2F%5E.%2A%3F%3A%5Cs%5CK.%2A%2F'
         71        SEND_VAR                                                 !1
         72        SEND_REF                                                 !5
         73        DO_ICALL                                         $28     
         74      > JMPZ                                                     $28, ->78
         75    >   FETCH_DIM_R                                      ~29     !5, 0
         76        QM_ASSIGN                                        ~30     ~29
         77      > JMP                                                      ->79
         78    >   QM_ASSIGN                                        ~30     !1
         79    >   QM_ASSIGN                                        ~17     ~30
         80      > JMP                                                      ->81
         81    >   SEND_VAL                                                 ~17
   17    82        SEND_VAR                                                 !1
    6    83        DO_ICALL                                                 
    5    84        PRE_INC                                                  !2
         85    >   IS_SMALLER                                               !2, 6
         86      > JMPNZ                                                    ~33, ->6
    4    87    > > JMP                                                      ->2
         88    >   FE_FREE                                                  $7
   20    89      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.77 ms | 1018 KiB | 21 Q