3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'this is a test sentence'; $max = 12; var_export( preg_replace( "/.{0,$max}\K .*/", '', $text ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/stA9c
function name:  (null)
number of ops:  14
compiled vars:  !0 = $text, !1 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'this+is+a+test+sentence'
    5     1        ASSIGN                                                   !1, 12
    6     2        INIT_FCALL                                               'var_export'
    7     3        INIT_FCALL                                               'preg_replace'
    8     4        ROPE_INIT                                     3  ~5      '%2F.%7B0%2C'
          5        ROPE_ADD                                      1  ~5      ~5, !1
          6        ROPE_END                                      2  ~4      ~5, '%7D%5CK+.%2A%2F'
          7        SEND_VAL                                                 ~4
    9     8        SEND_VAL                                                 ''
   10     9        SEND_VAR                                                 !0
    7    10        DO_ICALL                                         $7      
   10    11        SEND_VAR                                                 $7
    6    12        DO_ICALL                                                 
   12    13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.05 ms | 1001 KiB | 15 Q