3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings=['12jan','12 jan','12 jan','12/jan','12//jan','12/jan','12*/jan','12*//jan']; foreach($strings as $string){ var_export(preg_split('~(?<=[0-9])[*/ ]*(?=[a-z]+)~i',$string)); echo "\n"; var_export(preg_split('~\d+\K[*/ ]*~',$string)); echo "\n"; var_export(preg_match('~(\d+)[/* ]*([a-z]+)~i',$string,$out)?array_slice($out,1):'fail'); echo "\n"; var_export(preg_match('~(\d+)[/* ]*(.+)~',$string,$out)?array_slice($out,1):'fail'); echo "\n"; var_export(preg_match_all('~\d+|[a-z]+~i',$string,$out)?$out[0]:'fail'); echo "\n---\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 68
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 68
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 49
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
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 = 2
Branch analysis from position: 2
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
Branch analysis from position: 63
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 49
Branch analysis from position: 43
Branch analysis from position: 49
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
filename:       /in/prlLp
function name:  (null)
number of ops:  70
compiled vars:  !0 = $strings, !1 = $string, !2 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->68
          2    > > FE_FETCH_R                                               $4, !1, ->68
    6     3    >   INIT_FCALL                                               'var_export'
          4        INIT_FCALL                                               'preg_split'
          5        SEND_VAL                                                 '%7E%28%3F%3C%3D%5B0-9%5D%29%5B%2A%2F+%5D%2A%28%3F%3D%5Ba-z%5D%2B%29%7Ei'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
    7    10        ECHO                                                     '%0A'
    8    11        INIT_FCALL                                               'var_export'
         12        INIT_FCALL                                               'preg_split'
         13        SEND_VAL                                                 '%7E%5Cd%2B%5CK%5B%2A%2F+%5D%2A%7E'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
    9    18        ECHO                                                     '%0A'
   10    19        INIT_FCALL                                               'var_export'
         20        INIT_FCALL                                               'preg_match'
         21        SEND_VAL                                                 '%7E%28%5Cd%2B%29%5B%2F%2A+%5D%2A%28%5Ba-z%5D%2B%29%7Ei'
         22        SEND_VAR                                                 !1
         23        SEND_REF                                                 !2
         24        DO_ICALL                                         $9      
         25      > JMPZ                                                     $9, ->32
         26    >   INIT_FCALL                                               'array_slice'
         27        SEND_VAR                                                 !2
         28        SEND_VAL                                                 1
         29        DO_ICALL                                         $10     
         30        QM_ASSIGN                                        ~11     $10
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~11     'fail'
         33    >   SEND_VAL                                                 ~11
         34        DO_ICALL                                                 
   11    35        ECHO                                                     '%0A'
   12    36        INIT_FCALL                                               'var_export'
         37        INIT_FCALL                                               'preg_match'
         38        SEND_VAL                                                 '%7E%28%5Cd%2B%29%5B%2F%2A+%5D%2A%28.%2B%29%7E'
         39        SEND_VAR                                                 !1
         40        SEND_REF                                                 !2
         41        DO_ICALL                                         $13     
         42      > JMPZ                                                     $13, ->49
         43    >   INIT_FCALL                                               'array_slice'
         44        SEND_VAR                                                 !2
         45        SEND_VAL                                                 1
         46        DO_ICALL                                         $14     
         47        QM_ASSIGN                                        ~15     $14
         48      > JMP                                                      ->50
         49    >   QM_ASSIGN                                        ~15     'fail'
         50    >   SEND_VAL                                                 ~15
         51        DO_ICALL                                                 
   13    52        ECHO                                                     '%0A'
   14    53        INIT_FCALL                                               'var_export'
         54        INIT_FCALL                                               'preg_match_all'
         55        SEND_VAL                                                 '%7E%5Cd%2B%7C%5Ba-z%5D%2B%7Ei'
         56        SEND_VAR                                                 !1
         57        SEND_REF                                                 !2
         58        DO_ICALL                                         $17     
         59      > JMPZ                                                     $17, ->63
         60    >   FETCH_DIM_R                                      ~18     !2, 0
         61        QM_ASSIGN                                        ~19     ~18
         62      > JMP                                                      ->64
         63    >   QM_ASSIGN                                        ~19     'fail'
         64    >   SEND_VAL                                                 ~19
         65        DO_ICALL                                                 
   15    66        ECHO                                                     '%0A---%0A'
    5    67      > JMP                                                      ->2
         68    >   FE_FREE                                                  $4
   16    69      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
246.71 ms | 1020 KiB | 18 Q