3v4l.org

run code in 300+ PHP versions simultaneously
<?php $elements = array( "eng%C3%A5%C2%BF%C2", "Products" ); $elements = array_slice( $elements, 0, 1 ); $name = implode( '_', $elements ); $name = preg_replace( array( '/[^a-zA-Z0-9]+/', '/_+/', '/^_/', '/_$/' ), array( '_', '_', '', '' ), $name ); echo $name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jA8hC
function name:  (null)
number of ops:  20
compiled vars:  !0 = $elements, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_slice'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    5     7        INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 '_'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
    6    12        INIT_FCALL                                               'preg_replace'
         13        SEND_VAL                                                 <array>
    7    14        SEND_VAL                                                 <array>
    8    15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $7      
    6    17        ASSIGN                                                   !1, $7
    9    18        ECHO                                                     !1
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.79 ms | 1394 KiB | 19 Q