3v4l.org

run code in 300+ PHP versions simultaneously
<?php $line = "HELLO WORLD HOW ARE YOU I AM JUST FINE THANKS"; $plan = [9, 20]; var_dump(plan_split($line, $plan)); function plan_split(string $line, array $plan) : array { preg_match('/(.{' . implode('})(.{', $plan) . '})(.*)/s', $line, $m); array_shift($m); return $m; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pv759
function name:  (null)
number of ops:  10
compiled vars:  !0 = $line, !1 = $plan
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'HELLO++++WORLD+HOW+ARE+YOU+++I+AM+JUST+FINE+THANKS'
    5     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL_BY_NAME                                       'plan_split'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   14     9      > RETURN                                                   1

Function plan_split:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pv759
function name:  plan_split
number of ops:  20
compiled vars:  !0 = $line, !1 = $plan, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        INIT_FCALL                                               'preg_match'
          3        INIT_FCALL                                               'implode'
          4        SEND_VAL                                                 '%7D%29%28.%7B'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        CONCAT                                           ~4      '%2F%28.%7B', $3
          8        CONCAT                                           ~5      ~4, '%7D%29%28.%2A%29%2Fs'
          9        SEND_VAL                                                 ~5
         10        SEND_VAR                                                 !0
         11        SEND_REF                                                 !2
         12        DO_ICALL                                                 
   12    13        INIT_FCALL                                               'array_shift'
         14        SEND_REF                                                 !2
         15        DO_ICALL                                                 
   13    16        VERIFY_RETURN_TYPE                                       !2
         17      > RETURN                                                   !2
   14    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null

End of function plan_split

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.74 ms | 1396 KiB | 21 Q