3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = ["12345", "12346", "12347", "12398"]; $input = "12398"; $arr = preg_grep("/". 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/DkUpf
function name:  (null)
number of ops:  18
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, '12398'
    6     2        INIT_FCALL                                               'preg_grep'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 3
          7        DO_ICALL                                         $5      
          8        CONCAT                                           ~6      '%2F', $5
          9        CONCAT                                           ~7      ~6, '%2F'
         10        SEND_VAL                                                 ~7
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    8    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.54 ms | 1386 KiB | 19 Q