3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "00 a 51 - a9"; $numbers = ""; $chars = ""; preg_match_all("/(\d*)(\D*)/", $string, $matches); print_r($matches); foreach($matches as $match) { $numbers .= is_int($match) ? $match : ''; $chars .= !is_int($match) ? $match : ''; } var_dump($numbers); echo " "; var_dump($chars);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
Branch analysis from position: 24
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/Wic4B
function name:  (null)
number of ops:  36
compiled vars:  !0 = $string, !1 = $numbers, !2 = $chars, !3 = $matches, !4 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '00+a+51+-+a9'
    3     1        ASSIGN                                                   !1, ''
    4     2        ASSIGN                                                   !2, ''
    6     3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAL                                                 '%2F%28%5Cd%2A%29%28%5CD%2A%29%2F'
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !3
          7        DO_ICALL                                                 
    7     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                                 
    9    11      > FE_RESET_R                                       $10     !3, ->27
         12    > > FE_FETCH_R                                               $10, !4, ->27
   10    13    >   TYPE_CHECK                                   16          !4
         14      > JMPZ                                                     ~11, ->17
         15    >   QM_ASSIGN                                        ~12     !4
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~12     ''
         18    >   ASSIGN_OP                                     8          !1, ~12
   11    19        TYPE_CHECK                                   16  ~14     !4
         20        BOOL_NOT                                         ~15     ~14
         21      > JMPZ                                                     ~15, ->24
         22    >   QM_ASSIGN                                        ~16     !4
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~16     ''
         25    >   ASSIGN_OP                                     8          !2, ~16
    9    26      > JMP                                                      ->12
         27    >   FE_FREE                                                  $10
   14    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
   15    31        ECHO                                                     '+'
   16    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.02 ms | 1400 KiB | 19 Q