3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '012345678901234567890123456789012345678901234567890123456789'; $splitAtPoints = [1, 18, 32, 41, 108, 125, 137, 152, 161]; preg_match( sprintf( '/%s/us', implode( array_map( fn($quantifier) => "(.{{$quantifier}})?", $splitAtPoints ) ) ), $string, $match ); array_shift($match); var_export($match);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p1C3D
function name:  (null)
number of ops:  26
compiled vars:  !0 = $string, !1 = $splitAtPoints, !2 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '012345678901234567890123456789012345678901234567890123456789'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'preg_match'
    7     3        INIT_FCALL                                               'sprintf'
    8     4        SEND_VAL                                                 '%2F%25s%2Fus'
    9     5        INIT_FCALL                                               'implode'
   10     6        INIT_FCALL                                               'array_map'
   11     7        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          8        SEND_VAL                                                 ~5
   12     9        SEND_VAR                                                 !1
   10    10        DO_ICALL                                         $6      
   12    11        SEND_VAR                                                 $6
    9    12        DO_ICALL                                         $7      
   12    13        SEND_VAR                                                 $7
    7    14        DO_ICALL                                         $8      
   12    15        SEND_VAR                                                 $8
   16    16        SEND_VAR                                                 !0
   17    17        SEND_REF                                                 !2
    6    18        DO_ICALL                                                 
   19    19        INIT_FCALL                                               'array_shift'
         20        SEND_REF                                                 !2
         21        DO_ICALL                                                 
   20    22        INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p1C3D
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $quantifier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        ROPE_INIT                                     3  ~2      '%28.%7B'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%7D%29%3F'
          4      > RETURN                                                   ~1
          5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.47 ms | 1004 KiB | 19 Q