3v4l.org

run code in 500+ PHP versions simultaneously
<?php $keywords = array ('Rock', 'Paper', 'sciSSors'); $strings = array ( "This town rocks!", "Hello, world!", "Paper is patient", ); $rc = preg_grep( sprintf('/%s/i', implode('|', array_map('preg_quote', $keywords))), $strings ); var_dump($rc);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TBWbJ
function name:  (null)
number of ops:  19
compiled vars:  !0 = $keywords, !1 = $strings, !2 = $rc
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
   10     2        INIT_FCALL                                                   'preg_grep'
   11     3        INIT_FCALL                                                   'array_map'
          4        SEND_VAL                                                     'preg_quote'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $5      
          7        FRAMELESS_ICALL_2                implode             ~6      '%7C', $5
          8        ROPE_INIT                                         3  ~8      '%2F'
          9        ROPE_ADD                                          1  ~8      ~8, ~6
         10        ROPE_END                                          2  ~7      ~8, '%2Fi'
         11        SEND_VAL                                                     ~7
   12    12        SEND_VAR                                                     !1
   10    13        DO_ICALL                                             $10     
         14        ASSIGN                                                       !2, $10
   15    15        INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !2
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
138.36 ms | 2973 KiB | 16 Q