3v4l.org

run code in 300+ 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:  24
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                                  '%00%7Bclosure%7D%2Fin%2F8AYvu%3A4%240'
    6     4        SEND_VAL                                                 ~7
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $8      
    4     7        ASSIGN                                                   !2, $8
    7     8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%7C'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $10     
         12        CONCAT                                           ~11     '%2F%5Cb%28', $10
         13        CONCAT                                           ~12     ~11, '%29%5Cb%24%2F'
         14        ASSIGN                                                   !3, ~12
    8    15        INIT_FCALL                                               'preg_match'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !0
         18        SEND_REF                                                 !4
         19        DO_ICALL                                                 
    9    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F8AYvu%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8AYvu
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2F8AYvu%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.31 ms | 1401 KiB | 23 Q