3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = array( 'this is a string', 'this is $ a string', 'this is 12 string', 'this is $12.99 string', ); foreach ($strings as $string) { var_dump(strtolower(preg_replace('#[\s+]#', '', preg_replace('#[^a-z0-9\-\s]#', '-', $string)))); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/I2ubE
function name:  (null)
number of ops:  22
compiled vars:  !0 = $strings, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1      > FE_RESET_R                                       $3      !0, ->20
          2    > > FE_FETCH_R                                               $3, !1, ->20
    9     3    >   INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'strtolower'
          5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 '%23%5B%5Cs%2B%5D%23'
          7        SEND_VAL                                                 ''
          8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%23%5B%5Ea-z0-9%5C-%5Cs%5D%23'
         10        SEND_VAL                                                 '-'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                         $5      
         15        SEND_VAR                                                 $5
         16        DO_ICALL                                         $6      
         17        SEND_VAR                                                 $6
         18        DO_ICALL                                                 
    8    19      > JMP                                                      ->2
         20    >   FE_FREE                                                  $3
   10    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.96 ms | 1387 KiB | 19 Q