3v4l.org

run code in 300+ PHP versions simultaneously
<?php function in_string($needle, $haystack, $insensitive = false) { if ($insensitive) { return false !== stristr($haystack, $needle); } else { return false !== strpos($haystack, $needle); } } $needle = 'as'; $haystack = 'This is my assessment.'; var_dump(in_string($needle, $haystack, true)); var_dump(in_string($needle, $haystack, false));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pSlXa
function name:  (null)
number of ops:  19
compiled vars:  !0 = $needle, !1 = $haystack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'as'
   11     1        ASSIGN                                                   !1, 'This+is+my+assessment.'
   13     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'in_string'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 <true>
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   14    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'in_string'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 <false>
         15        DO_FCALL                                      0  $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function in_string:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pSlXa
function name:  in_string
number of ops:  18
compiled vars:  !0 = $needle, !1 = $haystack, !2 = $insensitive
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <false>
    3     3      > JMPZ                                                     !2, ->11
    4     4    >   INIT_FCALL                                               'stristr'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        TYPE_CHECK                                  1018  ~4      $3
          9      > RETURN                                                   ~4
         10*       JMP                                                      ->17
    6    11    >   INIT_FCALL                                               'strpos'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $5      
         15        TYPE_CHECK                                  1018  ~6      $5
         16      > RETURN                                                   ~6
    8    17*     > RETURN                                                   null

End of function in_string

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
202.53 ms | 1398 KiB | 21 Q