3v4l.org

run code in 300+ 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:  10
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        INIT_FCALL                                               'preg_replace'
   15     3        SEND_VAL                                                 '%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'
   16     4        SEND_VAL                                                 '-'
   17     5        SEND_VAR                                                 !0
   14     6        DO_ICALL                                         $2      
   17     7        SEND_VAR                                                 $2
   13     8        DO_ICALL                                                 
   19     9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.72 ms | 999 KiB | 15 Q