3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Here\'s some text and stuff what is your favorite color? @OTHER["favorite color"] Whats your favorite food? @OTHER["favorite food"]'; while(strpos($text, "@OTHER[") !== false){ $start = strpos($text, '@OTHER["') + 8; $stop = strpos($text, '"]', $start); echo substr($text, $start, $stop-$start); exit; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/hPl8e
function name:  (null)
number of ops:  29
compiled vars:  !0 = $text, !1 = $start, !2 = $stop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Here%27s+some+text+and+stuff%0Awhat+is+your+favorite+color%3F%0A%40OTHER%5B%22favorite+color%22%5D%0AWhats+your+favorite+food%3F%0A%40OTHER%5B%22favorite+food%22%5D'
    8     1      > JMP                                                      ->22
    9     2    >   INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%40OTHER%5B%22'
          5        DO_ICALL                                         $4      
          6        ADD                                              ~5      $4, 8
          7        ASSIGN                                                   !1, ~5
   10     8        INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '%22%5D'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
   11    14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        SUB                                              ~9      !2, !1
         18        SEND_VAL                                                 ~9
         19        DO_ICALL                                         $10     
         20        ECHO                                                     $10
         21      > EXIT                                                     
    8    22    >   INIT_FCALL                                               'strpos'
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 '%40OTHER%5B'
         25        DO_ICALL                                         $11     
         26        TYPE_CHECK                                  1018          $11
         27      > JMPNZ                                                    ~12, ->2
   12    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.13 ms | 1396 KiB | 17 Q