3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '8000000'; $data = substr($data, 2); //remove the 0x prefix from the string $data = str_replace(' ', '', $data); //remove the spaces from the string //$data is now '11210031' echo 'the product number is ' . $data[0] . "\n"; if ($data[1] == 1) { echo "this is a new product\n"; } else if ($data[1] == 2) { echo "this is a used product\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/uEYie
function name:  (null)
number of ops:  26
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '8000000'
    4     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
    5     6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '+'
          8        SEND_VAL                                                 ''
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        ASSIGN                                                   !0, $4
    7    12        FETCH_DIM_R                                      ~6      !0, 0
         13        CONCAT                                           ~7      'the+product+number+is+', ~6
         14        CONCAT                                           ~8      ~7, '%0A'
         15        ECHO                                                     ~8
    8    16        FETCH_DIM_R                                      ~9      !0, 1
         17        IS_EQUAL                                                 ~9, 1
         18      > JMPZ                                                     ~10, ->21
    9    19    >   ECHO                                                     'this+is+a+new+product%0A'
         20      > JMP                                                      ->25
   10    21    >   FETCH_DIM_R                                      ~11     !0, 1
         22        IS_EQUAL                                                 ~11, 2
         23      > JMPZ                                                     ~12, ->25
   11    24    >   ECHO                                                     'this+is+a+used+product%0A'
   12    25    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.77 ms | 1395 KiB | 17 Q