3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'SiteContentManagement'; echo strtolower(preg_replace('~(?!^)(?=[A-Z])~', '-', $string)); echo "\n"; echo strtolower(preg_replace('~(?!^)[A-Z]~', '-$0', $string)); echo "\n"; echo strtolower(preg_replace('~[^A-Z]+\K(?=[A-Z])~', '-', $string));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fijOP
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'SiteContentManagement'
    3     1        INIT_FCALL                                                   'strtolower'
          2        FRAMELESS_ICALL_3                preg_replace        ~2      '%7E%28%3F%21%5E%29%28%3F%3D%5BA-Z%5D%29%7E', '-'
          3        OP_DATA                                                      !0
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                             $3      
          6        ECHO                                                         $3
    4     7        ECHO                                                         '%0A'
    5     8        INIT_FCALL                                                   'strtolower'
          9        FRAMELESS_ICALL_3                preg_replace        ~4      '%7E%28%3F%21%5E%29%5BA-Z%5D%7E', '-%240'
         10        OP_DATA                                                      !0
         11        SEND_VAL                                                     ~4
         12        DO_ICALL                                             $5      
         13        ECHO                                                         $5
    6    14        ECHO                                                         '%0A'
    7    15        INIT_FCALL                                                   'strtolower'
         16        FRAMELESS_ICALL_3                preg_replace        ~6      '%7E%5B%5EA-Z%5D%2B%5CK%28%3F%3D%5BA-Z%5D%29%7E', '-'
         17        OP_DATA                                                      !0
         18        SEND_VAL                                                     ~6
         19        DO_ICALL                                             $7      
         20        ECHO                                                         $7
         21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.22 ms | 2300 KiB | 15 Q