3v4l.org

run code in 300+ 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:  23
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                                               'sprintf'
          4        SEND_VAL                                                 '%2F%25s%2Fi'
          5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 '%7C'
          7        INIT_FCALL                                               'array_map'
          8        SEND_VAL                                                 'preg_quote'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                         $7      
         15        SEND_VAR                                                 $7
   12    16        SEND_VAR                                                 !1
   10    17        DO_ICALL                                         $8      
         18        ASSIGN                                                   !2, $8
   15    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
308.79 ms | 1014 KiB | 18 Q