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 : ''; echo $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 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
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: 19
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 31
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 19
filename:       /in/qeR8A
function name:  (null)
number of ops:  40
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, ->19
         10    > > FE_FETCH_R                                               $10, !4, ->19
   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
   11    17        ECHO                                                     !4
    9    18      > JMP                                                      ->10
         19    >   FE_FREE                                                  $10
   14    20        FETCH_DIM_R                                      ~14     !3, 2
         21      > FE_RESET_R                                       $15     ~14, ->31
         22    > > FE_FETCH_R                                               $15, !4, ->31
   15    23    >   TYPE_CHECK                                   16  ~16     !4
         24        BOOL_NOT                                         ~17     ~16
         25      > JMPZ                                                     ~17, ->28
         26    >   QM_ASSIGN                                        ~18     !4
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~18     ''
         29    >   ASSIGN_OP                                     8          !2, ~18
   14    30      > JMP                                                      ->22
         31    >   FE_FREE                                                  $15
   18    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                                 
   19    35        ECHO                                                     '+'
   20    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.79 ms | 1392 KiB | 17 Q