3v4l.org

run code in 500+ PHP versions simultaneously
<?php $output= array('football GAME', 'cricket GAME', 'computer DEVICE','mobile DEVICE'); $string = 'DEVICE'; $devices = preg_grep("/" . $string . "/i", $output); Var_dump($devices);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HkQcu
function name:  (null)
number of ops:  13
compiled vars:  !0 = $output, !1 = $string, !2 = $devices
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, 'DEVICE'
    5     2        INIT_FCALL                                                   'preg_grep'
          3        CONCAT                                               ~5      '%2F', !1
          4        CONCAT                                               ~6      ~5, '%2Fi'
          5        SEND_VAL                                                     ~6
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $7      
          8        ASSIGN                                                       !2, $7
    6     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                                     
         12      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
207.26 ms | 2592 KiB | 15 Q