3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "ABC01 ABC02 ABC03 ABC04 ABC05 ABC06 "; echo preg_replace( '/\R+(?=ABC04)/', ' - ', trim($text) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BEloJ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ABC01%0AABC02%0AABC03%0AABC04%0AABC05%0AABC06%0A'
   11     1        INIT_FCALL                                               'preg_replace'
   12     2        SEND_VAL                                                 '%2F%5CR%2B%28%3F%3DABC04%29%2F'
   13     3        SEND_VAL                                                 '+-+'
   14     4        INIT_FCALL                                               'trim'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
   11     8        DO_ICALL                                         $3      
   14     9        ECHO                                                     $3
   15    10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.26 ms | 1436 KiB | 15 Q