3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = explode(" ","This is a string, keyword next, some more text. keyword next-word."); echo $string[array_search("keyword",$string) + 1]; /* OUTPUT next, */ echo $string[array_search("keyword",$string) + 3]; /* OUTPUT more */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4bnXr
function name:  (null)
number of ops:  20
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'explode'
          1        SEND_VAL                                                     '+'
          2        SEND_VAL                                                     'This+is+a+string%2C+keyword+next%2C+some+more+text.+keyword+next-word.'
          3        DO_ICALL                                             $1      
          4        ASSIGN                                                       !0, $1
    3     5        INIT_FCALL                                                   'array_search'
          6        SEND_VAL                                                     'keyword'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                             $3      
          9        ADD                                                  ~4      $3, 1
         10        FETCH_DIM_R                                          ~5      !0, ~4
         11        ECHO                                                         ~5
    5    12        INIT_FCALL                                                   'array_search'
         13        SEND_VAL                                                     'keyword'
         14        SEND_VAR                                                     !0
         15        DO_ICALL                                             $6      
         16        ADD                                                  ~7      $6, 3
         17        FETCH_DIM_R                                          ~8      !0, ~7
         18        ECHO                                                         ~8
    6    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
228.25 ms | 2313 KiB | 15 Q