3v4l.org

run code in 500+ PHP versions simultaneously
<?php function contains($text, $word) { return in_array($word, explode(' ', $text)) || in_array($word, explode(chr(160), $text)); } $tests = [ 'How are you?', 'Are you okay?', 'I think you are.' ]; foreach ($tests as $text) { echo "\n$text evaluates as "; var_export(contains($text, 'are')); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/E9dfD
function name:  (null)
number of ops:  17
compiled vars:  !0 = $tests, !1 = $text
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                       !0, <array>
   12     1      > FE_RESET_R                                           $3      !0, ->15
          2    > > FE_FETCH_R                                                   $3, !1, ->15
   13     3    >   ROPE_INIT                                         3  ~5      '%0A'
          4        ROPE_ADD                                          1  ~5      ~5, !1
          5        ROPE_END                                          2  ~4      ~5, '+evaluates+as+'
          6        ECHO                                                         ~4
   14     7        INIT_FCALL                                                   'var_export'
          8        INIT_FCALL                                                   'contains'
          9        SEND_VAR                                                     !1
         10        SEND_VAL                                                     'are'
         11        DO_FCALL                                          0  $7      
         12        SEND_VAR                                                     $7
         13        DO_ICALL                                                     
   12    14      > JMP                                                          ->2
         15    >   FE_FREE                                                      $3
   15    16      > RETURN                                                       1

Function contains:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/E9dfD
function name:  contains
number of ops:  16
compiled vars:  !0 = $text, !1 = $word
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    4     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '+'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $2      
          6        FRAMELESS_ICALL_2                in_array            ~3      !1, $2
          7      > JMPNZ_EX                                             ~3      ~3, ->14
    5     8    >   INIT_FCALL                                                   'explode'
          9        SEND_VAL                                                     '%A0'
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                             $4      
         12        FRAMELESS_ICALL_2                in_array            ~5      !1, $4
         13        BOOL                                                 ~3      ~5
         14    > > RETURN                                                       ~3
    6    15*     > RETURN                                                       null

End of function contains

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.58 ms | 2073 KiB | 18 Q