3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'PHP is a server side web programming language , PHP is amazing , I love PHP'; $array = array('html','css','javascript','ajax','html5','css3','jquery','PHP'); $escaped_array = array_map(function($value){ return preg_quote($value, '/'); }, $array); $regex = '/\b(' . implode('|', $escaped_array) . ')\b$/'; preg_match($regex, $string, $match); print_r($match);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8AYvu
function name:  (null)
number of ops:  21
compiled vars:  !0 = $string, !1 = $array, !2 = $escaped_array, !3 = $regex, !4 = $match
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'PHP+is+a+server+side+web+programming+language+%2C+PHP+is+amazing+%2C+I+love+PHP'
    3     1        ASSIGN                                                       !1, <array>
    4     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
    6     4        SEND_VAL                                                     ~7
          5        SEND_VAR                                                     !1
    4     6        DO_ICALL                                             $8      
          7        ASSIGN                                                       !2, $8
    7     8        FRAMELESS_ICALL_2                implode             ~10     '%7C', !2
          9        CONCAT                                               ~11     '%2F%5Cb%28', ~10
         10        CONCAT                                               ~12     ~11, '%29%5Cb%24%2F'
         11        ASSIGN                                                       !3, ~12
    8    12        INIT_FCALL                                                   'preg_match'
         13        SEND_VAR                                                     !3
         14        SEND_VAR                                                     !0
         15        SEND_REF                                                     !4
         16        DO_ICALL                                                     
    9    17        INIT_FCALL                                                   'print_r'
         18        SEND_VAR                                                     !4
         19        DO_ICALL                                                     
         20      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8AYvu
function name:  {closure:/in/8AYvu:4}
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'preg_quote'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     '%2F'
          4        DO_ICALL                                             $1      
          5      > RETURN                                                       $1
    6     6*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
178.01 ms | 2289 KiB | 17 Q