3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = 'Hello world.'; $test = 'world'; $pos = strpos($search, $test); echo $pos; if (!$pos) echo "1. Not found"; else echo "1. Found"; echo "\r\n"; if ($pos != true) echo "2. Not found"; else echo "2. Found"; echo "\r\n"; if ($pos === false) echo "3. Not found"; else echo "3. Found"; echo "\r\n"; if ($pos == false) echo "4. Not found"; else echo "4. Found"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
Branch analysis from position: 30
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
Branch analysis from position: 24
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
Branch analysis from position: 18
filename:       /in/TYt5s
function name:  (null)
number of ops:  32
compiled vars:  !0 = $search, !1 = $test, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello+world.'
    4     1        ASSIGN                                                   !1, 'world'
    6     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    8     7        ECHO                                                     !2
   10     8        BOOL_NOT                                         ~7      !2
          9      > JMPZ                                                     ~7, ->12
   11    10    >   ECHO                                                     '1.+Not+found'
         11      > JMP                                                      ->13
   13    12    >   ECHO                                                     '1.+Found'
   15    13    >   ECHO                                                     '%0D%0A'
   17    14        BOOL_NOT                                         ~8      !2
         15      > JMPZ                                                     ~8, ->18
   18    16    >   ECHO                                                     '2.+Not+found'
         17      > JMP                                                      ->19
   20    18    >   ECHO                                                     '2.+Found'
   22    19    >   ECHO                                                     '%0D%0A'
   24    20        TYPE_CHECK                                    4          !2
         21      > JMPZ                                                     ~9, ->24
   25    22    >   ECHO                                                     '3.+Not+found'
         23      > JMP                                                      ->25
   27    24    >   ECHO                                                     '3.+Found'
   29    25    >   ECHO                                                     '%0D%0A'
   31    26        BOOL_NOT                                         ~10     !2
         27      > JMPZ                                                     ~10, ->30
   32    28    >   ECHO                                                     '4.+Not+found'
         29      > JMP                                                      ->31
   34    30    >   ECHO                                                     '4.+Found'
   36    31    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.37 ms | 1405 KiB | 15 Q