3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = ["12345", "12346", "12347", "12398"]; $input = "12498"; $arr = preg_grep("/^". preg_quote(substr($input,0,3)) . ".*$/", $numbers); Var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fVAS6
function name:  (null)
number of ops:  21
compiled vars:  !0 = $numbers, !1 = $input, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, '12498'
    6     2        INIT_FCALL                                               'preg_grep'
          3        INIT_FCALL                                               'preg_quote'
          4        INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 3
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        CONCAT                                           ~7      '%2F%5E', $6
         12        CONCAT                                           ~8      ~7, '.%2A%24%2F'
         13        SEND_VAL                                                 ~8
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
    8    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.22 ms | 1395 KiB | 21 Q