3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'test-qwe123-test-example-demo-1a-3321-0-3555-0'; echo preg_replace('/(?!([\d-]+(?!\w))).-?/', '', $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t0NAR
function name:  (null)
number of ops:  8
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'test-qwe123-test-example-demo-1a-3321-0-3555-0'
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%3F%21%28%5B%5Cd-%5D%2B%28%3F%21%5Cw%29%29%29.-%3F%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.17 ms | 1393 KiB | 15 Q