3v4l.org

run code in 300+ PHP versions simultaneously
<?php function in_array_r($item , $array){ return preg_match('/"'. $item .'"/i' , json_encode($array)); } var_dump(in_array_r(preg_quote('Something (12) Pieces', '/'), array('title' => 'Something (12) Pieces')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p9n43
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'in_array_r'
          2        INIT_FCALL                                               'preg_quote'
          3        SEND_VAL                                                 'Something+%2812%29+Pieces'
          4        SEND_VAL                                                 '%2F'
          5        DO_ICALL                                         $0      
          6        SEND_VAR                                                 $0
          7        SEND_VAL                                                 <array>
          8        DO_FCALL                                      0  $1      
          9        SEND_VAR                                                 $1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function in_array_r:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p9n43
function name:  in_array_r
number of ops:  13
compiled vars:  !0 = $item, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'preg_match'
          3        CONCAT                                           ~2      '%2F%22', !0
          4        CONCAT                                           ~3      ~2, '%22%2Fi'
          5        SEND_VAL                                                 ~3
          6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                         $5      
         11      > RETURN                                                   $5
    5    12*     > RETURN                                                   null

End of function in_array_r

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.3 ms | 1398 KiB | 22 Q