3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "00 a 51 - a9b"; $numbers = ""; $chars = ""; preg_match_all("/(\d*)(\D*)/", $string, $matches); //print_r($matches); foreach($matches[1] as $match) { $numbers .= is_int($match) ? $match : ''; } foreach($matches[2] as $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 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 30
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 18
filename:       /in/kRu2i
function name:  (null)
number of ops:  39
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+-+a9b'
    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                                                 
    9     8        FETCH_DIM_R                                      ~9      !3, 1
          9      > FE_RESET_R                                       $10     ~9, ->18
         10    > > FE_FETCH_R                                               $10, !4, ->18
   10    11    >   TYPE_CHECK                                   16          !4
         12      > JMPZ                                                     ~11, ->15
         13    >   QM_ASSIGN                                        ~12     !4
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~12     ''
         16    >   ASSIGN_OP                                     8          !1, ~12
    9    17      > JMP                                                      ->10
         18    >   FE_FREE                                                  $10
   13    19        FETCH_DIM_R                                      ~14     !3, 2
         20      > FE_RESET_R                                       $15     ~14, ->30
         21    > > FE_FETCH_R                                               $15, !4, ->30
   14    22    >   TYPE_CHECK                                   16  ~16     !4
         23        BOOL_NOT                                         ~17     ~16
         24      > JMPZ                                                     ~17, ->27
         25    >   QM_ASSIGN                                        ~18     !4
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~18     ''
         28    >   ASSIGN_OP                                     8          !2, ~18
   13    29      > JMP                                                      ->21
         30    >   FE_FREE                                                  $15
   17    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                                 
   18    34        ECHO                                                     '+'
   19    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.6 ms | 1392 KiB | 17 Q