3v4l.org

run code in 500+ PHP versions simultaneously
<?php $tests = [ 'getADogThenROCKInTheUSA', 'SomeOfTheWords', 'getADog', 'ADog', 'aDog', 'XML', 'SimpleXMLReader', 'FREE4NOW', '123ABC', 'DEF456', 'ghi789', 'wtf666Omg', 'PHP8Point3', ]; foreach ($tests as $test) { printf("%25s => %s\n", $test, strtolower(preg_replace('/(?>[A-Z]?[a-z]+|[A-Z]+(?=[A-Z][a-z]|[^A-Za-z])|[^A-Za-z]+)\K(?!$)/', '-', $test))); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/KsCnb
function name:  (null)
number of ops:  16
compiled vars:  !0 = $tests, !1 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   19     1      > FE_RESET_R                                           $3      !0, ->14
          2    > > FE_FETCH_R                                                   $3, !1, ->14
   20     3    >   INIT_FCALL                                                   'printf'
          4        SEND_VAL                                                     '%2525s+%3D%3E+%25s%0A'
          5        SEND_VAR                                                     !1
          6        INIT_FCALL                                                   'strtolower'
          7        FRAMELESS_ICALL_3                preg_replace        ~4      '%2F%28%3F%3E%5BA-Z%5D%3F%5Ba-z%5D%2B%7C%5BA-Z%5D%2B%28%3F%3D%5BA-Z%5D%5Ba-z%5D%7C%5B%5EA-Za-z%5D%29%7C%5B%5EA-Za-z%5D%2B%29%5CK%28%3F%21%24%29%2F', '-'
          8        OP_DATA                                                      !1
          9        SEND_VAL                                                     ~4
         10        DO_ICALL                                             $5      
         11        SEND_VAR                                                     $5
         12        DO_ICALL                                                     
   19    13      > JMP                                                          ->2
         14    >   FE_FREE                                                      $3
   21    15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.48 ms | 1656 KiB | 15 Q