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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.78 ms | 1404 KiB | 18 Q