3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sc = 'hello 8491241 some text 6254841 some text 568241 414844:412'; preg_match_all('/[0-9]{5,10}/', $sc, $matches1); preg_match_all('/[0-9]{5,10}:[0-9]{1,5}/', $sc, $matches2); $my_matches[1] = $matches1[0]; $my_matches[2] = $matches2[0]; $cub[1] = function($match) { return array( 'batch' => $match, 'type' => '1', ); }; $cub[2] = function($match) { return array( 'batch' => $match, 'type' => '2', ); }; $result = call_user_func_array('array_merge', array_map(function($a, $b) { return array_map($a, $b); }, $cub, $my_matches)); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2ErJA
function name:  (null)
number of ops:  38
compiled vars:  !0 = $sc, !1 = $matches1, !2 = $matches2, !3 = $my_matches, !4 = $cub, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'hello+8491241+some+text+6254841+some+text+568241+414844%3A412'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5B0-9%5D%7B5%2C10%7D%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'preg_match_all'
          7        SEND_VAL                                                 '%2F%5B0-9%5D%7B5%2C10%7D%3A%5B0-9%5D%7B1%2C5%7D%2F'
          8        SEND_VAR                                                 !0
          9        SEND_REF                                                 !2
         10        DO_ICALL                                                 
    7    11        FETCH_DIM_R                                      ~10     !1, 0
         12        ASSIGN_DIM                                               !3, 1
         13        OP_DATA                                                  ~10
    8    14        FETCH_DIM_R                                      ~12     !2, 0
         15        ASSIGN_DIM                                               !3, 2
         16        OP_DATA                                                  ~12
   10    17        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2ErJA%3A10%240'
         18        ASSIGN_DIM                                               !4, 1
   16    19        OP_DATA                                                  ~14
   18    20        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2ErJA%3A18%241'
         21        ASSIGN_DIM                                               !4, 2
   24    22        OP_DATA                                                  ~16
   26    23        INIT_FCALL                                               'array_merge'
         24        INIT_FCALL                                               'array_map'
         25        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2ErJA%3A26%242'
   27    26        SEND_VAL                                                 ~17
         27        SEND_VAR                                                 !4
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $18     
         30        SEND_ARRAY                                               $18
         31        CHECK_UNDEF_ARGS                                         
         32        DO_FCALL                                      0  $19     
   26    33        ASSIGN                                                   !5, $19
   28    34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !5
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F2ErJA%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2ErJA
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   13     1        INIT_ARRAY                                       ~1      !0, 'batch'
   14     2        ADD_ARRAY_ELEMENT                                ~1      '1', 'type'
          3      > RETURN                                                   ~1
   16     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2ErJA%3A10%240

Function %00%7Bclosure%7D%2Fin%2F2ErJA%3A18%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2ErJA
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   21     1        INIT_ARRAY                                       ~1      !0, 'batch'
   22     2        ADD_ARRAY_ELEMENT                                ~1      '2', 'type'
          3      > RETURN                                                   ~1
   24     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2ErJA%3A18%241

Function %00%7Bclosure%7D%2Fin%2F2ErJA%3A26%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2ErJA
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   27     2        INIT_FCALL                                               'array_map'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2ErJA%3A26%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.41 ms | 1405 KiB | 21 Q