3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'r;anum;l={"5":"10"}'; $output = array(); foreach (explode(';', $input) as $part) { $count = preg_match_all('([a-zA-Z0-9]+)', $part, $matches); $output[] = ($count > 1) ? '[' . implode(',', $matches[0]) . ']' : reset($matches[0]); } print_r($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 33
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 33
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/9mLQ1
function name:  (null)
number of ops:  38
compiled vars:  !0 = $input, !1 = $output, !2 = $part, !3 = $count, !4 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'r%3Banum%3Bl%3D%7B%225%22%3A%2210%22%7D'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%3B'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6      > FE_RESET_R                                       $8      $7, ->33
          7    > > FE_FETCH_R                                               $8, !2, ->33
    7     8    >   INIT_FCALL                                               'preg_match_all'
          9        SEND_VAL                                                 '%28%5Ba-zA-Z0-9%5D%2B%29'
         10        SEND_VAR                                                 !2
         11        SEND_REF                                                 !4
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
    8    14        IS_SMALLER                                               1, !3
         15      > JMPZ                                                     ~12, ->25
         16    >   INIT_FCALL                                               'implode'
         17        SEND_VAL                                                 '%2C'
         18        FETCH_DIM_R                                      ~13     !4, 0
         19        SEND_VAL                                                 ~13
         20        DO_ICALL                                         $14     
         21        CONCAT                                           ~15     '%5B', $14
         22        CONCAT                                           ~16     ~15, '%5D'
         23        QM_ASSIGN                                        ~17     ~16
         24      > JMP                                                      ->30
         25    >   INIT_FCALL                                               'reset'
         26        FETCH_DIM_W                                      $18     !4, 0
         27        SEND_REF                                                 $18
         28        DO_ICALL                                         $19     
         29        QM_ASSIGN                                        ~17     $19
         30    >   ASSIGN_DIM                                               !1
         31        OP_DATA                                                  ~17
    6    32      > JMP                                                      ->7
         33    >   FE_FREE                                                  $8
   11    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.22 ms | 1400 KiB | 23 Q