3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = 'Hello world.'; $test = 'world'; $pos = strpos($search, $test); echo $pos + "\r\n"; 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 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
Branch analysis from position: 31
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
Branch analysis from position: 25
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
Branch analysis from position: 19
filename:       /in/OEONE
function name:  (null)
number of ops:  33
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        ADD                                              ~7      !2, '%0D%0A'
          8        ECHO                                                     ~7
   10     9        BOOL_NOT                                         ~8      !2
         10      > JMPZ                                                     ~8, ->13
   11    11    >   ECHO                                                     '1.+Not+found'
         12      > JMP                                                      ->14
   13    13    >   ECHO                                                     '1.+Found'
   15    14    >   ECHO                                                     '%0D%0A'
   17    15        BOOL_NOT                                         ~9      !2
         16      > JMPZ                                                     ~9, ->19
   18    17    >   ECHO                                                     '2.+Not+found'
         18      > JMP                                                      ->20
   20    19    >   ECHO                                                     '2.+Found'
   22    20    >   ECHO                                                     '%0D%0A'
   24    21        TYPE_CHECK                                    4          !2
         22      > JMPZ                                                     ~10, ->25
   25    23    >   ECHO                                                     '3.+Not+found'
         24      > JMP                                                      ->26
   27    25    >   ECHO                                                     '3.+Found'
   29    26    >   ECHO                                                     '%0D%0A'
   31    27        BOOL_NOT                                         ~11     !2
         28      > JMPZ                                                     ~11, ->31
   32    29    >   ECHO                                                     '4.+Not+found'
         30      > JMP                                                      ->32
   34    31    >   ECHO                                                     '4.+Found'
   36    32    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.14 ms | 948 KiB | 16 Q