3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Attempt to reproduce "element" issue $elements = array( "eng%C3%A5%C2%BF%C2", "Products" );// url, exploded by "/" $saList = array( "eng", "fre" ); $URIMatchElement = 1;// URIMatchElement setting $elements = array_slice( $elements, 0, $URIMatchElement ); $name = implode( '_', $elements ); $name = preg_replace( array( '/[^a-zA-Z0-9]+/', '/_+/', '/^_/', '/_$/' ), array( '_', '_', '', '' ), $name ); echo $name; echo in_array( $name, $saList ) ? 1 : 0;// if issue is true, then this should be true
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/id3WL
function name:  (null)
number of ops:  31
compiled vars:  !0 = $elements, !1 = $saList, !2 = $URIMatchElement, !3 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, 1
    9     3        INIT_FCALL                                               'array_slice'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !0, $7
   10     9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '_'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
   11    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 <array>
   12    16        SEND_VAL                                                 <array>
   13    17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $11     
   11    19        ASSIGN                                                   !3, $11
   15    20        ECHO                                                     !3
   16    21        INIT_FCALL                                               'in_array'
         22        SEND_VAR                                                 !3
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $13     
         25      > JMPZ                                                     $13, ->28
         26    >   QM_ASSIGN                                        ~14     1
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~14     0
         29    >   ECHO                                                     ~14
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.4 ms | 1396 KiB | 21 Q