3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex1 = "/[^0-9a-z\s]+/i"; // Search for everything that is not alphanumeric or whitespace $regex2 = "/\s+/"; // Search for whitespace $regex3 = "/-+$/"; // search for trailing dashes $text = "Hello World - This/That is (Test)"; // replace in turn, non-alpha with space, one or more spaces with dash, one or more trailing dashes with nothing $text2 = preg_replace([$regex1, $regex2, $regex3],[' ','-',''], $text); $text2 = strtolower($text2); echo $text2;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pe5hC
function name:  (null)
number of ops:  19
compiled vars:  !0 = $regex1, !1 = $regex2, !2 = $regex3, !3 = $text, !4 = $text2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5B%5E0-9a-z%5Cs%5D%2B%2Fi'
    4     1        ASSIGN                                                   !1, '%2F%5Cs%2B%2F'
    5     2        ASSIGN                                                   !2, '%2F-%2B%24%2F'
    7     3        ASSIGN                                                   !3, 'Hello+World+-+This%2FThat+is+%28Test%29'
   10     4        INIT_FCALL                                               'preg_replace'
          5        INIT_ARRAY                                       ~9      !0
          6        ADD_ARRAY_ELEMENT                                ~9      !1
          7        ADD_ARRAY_ELEMENT                                ~9      !2
          8        SEND_VAL                                                 ~9
          9        SEND_VAL                                                 <array>
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !4, $10
   11    13        INIT_FCALL                                               'strtolower'
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !4, $12
   12    17        ECHO                                                     !4
   13    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.57 ms | 1395 KiB | 17 Q