3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "str starts with 0:" . (strpos('CNXXXXXX122334.txt','CN') === 0) . "\n"; echo "str does not starts with 0:" . (strpos('CNXXXXXX122334.txt','XT') === 0) . "\n"; echo "str starts with 0:" . (strpos('CNXXXXXX122334.txt','XT') == 1) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/68JvE
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'strpos'
          1        SEND_VAL                                                 'CNXXXXXX122334.txt'
          2        SEND_VAL                                                 'CN'
          3        DO_ICALL                                         $0      
          4        IS_IDENTICAL                                     ~1      $0, 0
          5        CONCAT                                           ~2      'str+starts+with+0%3A', ~1
          6        CONCAT                                           ~3      ~2, '%0A'
          7        ECHO                                                     ~3
    3     8        INIT_FCALL                                               'strpos'
          9        SEND_VAL                                                 'CNXXXXXX122334.txt'
         10        SEND_VAL                                                 'XT'
         11        DO_ICALL                                         $4      
         12        IS_IDENTICAL                                     ~5      $4, 0
         13        CONCAT                                           ~6      'str+does+not+starts+with+0%3A', ~5
         14        CONCAT                                           ~7      ~6, '%0A'
         15        ECHO                                                     ~7
    4    16        INIT_FCALL                                               'strpos'
         17        SEND_VAL                                                 'CNXXXXXX122334.txt'
         18        SEND_VAL                                                 'XT'
         19        DO_ICALL                                         $8      
         20        IS_EQUAL                                         ~9      $8, 1
         21        CONCAT                                           ~10     'str+starts+with+0%3A', ~9
         22        CONCAT                                           ~11     ~10, '%0A'
         23        ECHO                                                     ~11
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.28 ms | 1395 KiB | 15 Q