3v4l.org

run code in 300+ PHP versions simultaneously
<?php // let's say I want to add "Has" at beginning (if doesn't exist) $string_1 = "AnaHasSomeApples"; // we need to add $string_2 = "HsSomeApples"; // we need to add $string_3 = "HasApplesAlready"; // already exists at the beginning echo "string_1: ". (strpos($string_1,"Has") !== 0 ? "Has".$string_1: $string_1)."\n"; echo "string_2: ". (strpos($string_2,"Has") !== 0 ? "Has".$string_2: $string_2)."\n"; echo "string_3: ". (strpos($string_3,"Has") !== 0 ? "Has".$string_3: $string_3)."\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 38
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 38
Branch analysis from position: 35
Branch analysis from position: 38
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
Branch analysis from position: 25
filename:       /in/vvfER
function name:  (null)
number of ops:  43
compiled vars:  !0 = $string_1, !1 = $string_2, !2 = $string_3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'AnaHasSomeApples'
    5     1        ASSIGN                                                   !1, 'HsSomeApples'
    6     2        ASSIGN                                                   !2, 'HasApplesAlready'
    8     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'Has'
          6        DO_ICALL                                         $6      
          7        IS_NOT_IDENTICAL                                         $6, 0
          8      > JMPZ                                                     ~7, ->12
          9    >   CONCAT                                           ~8      'Has', !0
         10        QM_ASSIGN                                        ~9      ~8
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~9      !0
         13    >   CONCAT                                           ~10     'string_1%3A+', ~9
         14        CONCAT                                           ~11     ~10, '%0A'
         15        ECHO                                                     ~11
    9    16        INIT_FCALL                                               'strpos'
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 'Has'
         19        DO_ICALL                                         $12     
         20        IS_NOT_IDENTICAL                                         $12, 0
         21      > JMPZ                                                     ~13, ->25
         22    >   CONCAT                                           ~14     'Has', !1
         23        QM_ASSIGN                                        ~15     ~14
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~15     !1
         26    >   CONCAT                                           ~16     'string_2%3A+', ~15
         27        CONCAT                                           ~17     ~16, '%0A'
         28        ECHO                                                     ~17
   10    29        INIT_FCALL                                               'strpos'
         30        SEND_VAR                                                 !2
         31        SEND_VAL                                                 'Has'
         32        DO_ICALL                                         $18     
         33        IS_NOT_IDENTICAL                                         $18, 0
         34      > JMPZ                                                     ~19, ->38
         35    >   CONCAT                                           ~20     'Has', !2
         36        QM_ASSIGN                                        ~21     ~20
         37      > JMP                                                      ->39
         38    >   QM_ASSIGN                                        ~21     !2
         39    >   CONCAT                                           ~22     'string_3%3A+', ~21
         40        CONCAT                                           ~23     ~22, '%0A'
         41        ECHO                                                     ~23
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.6 ms | 1015 KiB | 14 Q