3v4l.org

run code in 500+ PHP versions simultaneously
<?php $tests = [ 'foo', 'fooBar', 'foo123', '123Foo', 'fooBar123', 'foo123Bar', '123FooBar', ]; var_export( preg_replace( '/(?:\d++|[A-Za-z]?[a-z]++)\K(?!$)/', '-', $tests ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qVDEv
function name:  (null)
number of ops:  7
compiled vars:  !0 = $tests
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   13     1        INIT_FCALL                                                   'var_export'
   14     2        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F%28%3F%3A%5Cd%2B%2B%7C%5BA-Za-z%5D%3F%5Ba-z%5D%2B%2B%29%5CK%28%3F%21%24%29%2F', '-'
   17     3        OP_DATA                                                      !0
          4        SEND_VAL                                                     ~2
   13     5        DO_ICALL                                                     
   19     6      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.36 ms | 1730 KiB | 14 Q