3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = new stdclass(); $result->introtext = "<p class=\"text_titel_ohne_autor\">Spoiler!</p>"; if(strpos($result->introtext, "<p class=\"text_titel\"") !== false){ $titleStart = strpos($result->introtext, "<p class=\"text_titel\">") + 22; $titleEnd = strpos($result->introtext, "</p>", $titleStart); $result->maintitle = strip_tags(substr($result->introtext, $titleStart, $titleEnd - $titleStart)); } else if(strpos($result->introtext, "<p class=\"text_titel_ohne_autor\"") !== false){ $titleStart = strpos($result->introtext, "<p class=\"text_titel_ohne_autor\">") + 33; $titleEnd = strpos($result->introtext, "</p>", $titleStart); $result->maintitle = strip_tags(substr($result->introtext, $titleStart, $titleEnd - $titleStart)); } else if(strpos($result->introtext, "<span class=\"text_titel\">") !== false){ $titleStart = strpos($result->introtext, "<span class=\"text_titel\">") + 25; $titleEnd = strpos($result->introtext, "</span>", $titleStart); $result->maintitle = strip_tags(substr($result->introtext, $titleStart, $titleEnd - $titleStart)); } echo $result->maintitle;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 39
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 73
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 80, Position 2 = 106
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 106
filename:       /in/8ZOgA
function name:  (null)
number of ops:  109
compiled vars:  !0 = $result, !1 = $titleStart, !2 = $titleEnd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'stdclass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        ASSIGN_OBJ                                               !0, 'introtext'
          4        OP_DATA                                                  '%3Cp+class%3D%22text_titel_ohne_autor%22%3ESpoiler%21%3C%2Fp%3E'
    6     5        INIT_FCALL                                               'strpos'
          6        FETCH_OBJ_R                                      ~7      !0, 'introtext'
          7        SEND_VAL                                                 ~7
          8        SEND_VAL                                                 '%3Cp+class%3D%22text_titel%22'
          9        DO_ICALL                                         $8      
         10        TYPE_CHECK                                  1018          $8
         11      > JMPZ                                                     ~9, ->39
    7    12    >   INIT_FCALL                                               'strpos'
         13        FETCH_OBJ_R                                      ~10     !0, 'introtext'
         14        SEND_VAL                                                 ~10
         15        SEND_VAL                                                 '%3Cp+class%3D%22text_titel%22%3E'
         16        DO_ICALL                                         $11     
         17        ADD                                              ~12     $11, 22
         18        ASSIGN                                                   !1, ~12
    8    19        INIT_FCALL                                               'strpos'
         20        FETCH_OBJ_R                                      ~14     !0, 'introtext'
         21        SEND_VAL                                                 ~14
         22        SEND_VAL                                                 '%3C%2Fp%3E'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $15     
         25        ASSIGN                                                   !2, $15
    9    26        INIT_FCALL                                               'strip_tags'
         27        INIT_FCALL                                               'substr'
         28        FETCH_OBJ_R                                      ~18     !0, 'introtext'
         29        SEND_VAL                                                 ~18
         30        SEND_VAR                                                 !1
         31        SUB                                              ~19     !2, !1
         32        SEND_VAL                                                 ~19
         33        DO_ICALL                                         $20     
         34        SEND_VAR                                                 $20
         35        DO_ICALL                                         $21     
         36        ASSIGN_OBJ                                               !0, 'maintitle'
         37        OP_DATA                                                  $21
         38      > JMP                                                      ->106
   10    39    >   INIT_FCALL                                               'strpos'
         40        FETCH_OBJ_R                                      ~22     !0, 'introtext'
         41        SEND_VAL                                                 ~22
         42        SEND_VAL                                                 '%3Cp+class%3D%22text_titel_ohne_autor%22'
         43        DO_ICALL                                         $23     
         44        TYPE_CHECK                                  1018          $23
         45      > JMPZ                                                     ~24, ->73
   11    46    >   INIT_FCALL                                               'strpos'
         47        FETCH_OBJ_R                                      ~25     !0, 'introtext'
         48        SEND_VAL                                                 ~25
         49        SEND_VAL                                                 '%3Cp+class%3D%22text_titel_ohne_autor%22%3E'
         50        DO_ICALL                                         $26     
         51        ADD                                              ~27     $26, 33
         52        ASSIGN                                                   !1, ~27
   12    53        INIT_FCALL                                               'strpos'
         54        FETCH_OBJ_R                                      ~29     !0, 'introtext'
         55        SEND_VAL                                                 ~29
         56        SEND_VAL                                                 '%3C%2Fp%3E'
         57        SEND_VAR                                                 !1
         58        DO_ICALL                                         $30     
         59        ASSIGN                                                   !2, $30
   13    60        INIT_FCALL                                               'strip_tags'
         61        INIT_FCALL                                               'substr'
         62        FETCH_OBJ_R                                      ~33     !0, 'introtext'
         63        SEND_VAL                                                 ~33
         64        SEND_VAR                                                 !1
         65        SUB                                              ~34     !2, !1
         66        SEND_VAL                                                 ~34
         67        DO_ICALL                                         $35     
         68        SEND_VAR                                                 $35
         69        DO_ICALL                                         $36     
         70        ASSIGN_OBJ                                               !0, 'maintitle'
         71        OP_DATA                                                  $36
         72      > JMP                                                      ->106
   14    73    >   INIT_FCALL                                               'strpos'
         74        FETCH_OBJ_R                                      ~37     !0, 'introtext'
         75        SEND_VAL                                                 ~37
         76        SEND_VAL                                                 '%3Cspan+class%3D%22text_titel%22%3E'
         77        DO_ICALL                                         $38     
         78        TYPE_CHECK                                  1018          $38
         79      > JMPZ                                                     ~39, ->106
   15    80    >   INIT_FCALL                                               'strpos'
         81        FETCH_OBJ_R                                      ~40     !0, 'introtext'
         82        SEND_VAL                                                 ~40
         83        SEND_VAL                                                 '%3Cspan+class%3D%22text_titel%22%3E'
         84        DO_ICALL                                         $41     
         85        ADD                                              ~42     $41, 25
         86        ASSIGN                                                   !1, ~42
   16    87        INIT_FCALL                                               'strpos'
         88        FETCH_OBJ_R                                      ~44     !0, 'introtext'
         89        SEND_VAL                                                 ~44
         90        SEND_VAL                                                 '%3C%2Fspan%3E'
         91        SEND_VAR                                                 !1
         92        DO_ICALL                                         $45     
         93        ASSIGN                                                   !2, $45
   17    94        INIT_FCALL                                               'strip_tags'
         95        INIT_FCALL                                               'substr'
         96        FETCH_OBJ_R                                      ~48     !0, 'introtext'
         97        SEND_VAL                                                 ~48
         98        SEND_VAR                                                 !1
         99        SUB                                              ~49     !2, !1
        100        SEND_VAL                                                 ~49
        101        DO_ICALL                                         $50     
        102        SEND_VAR                                                 $50
        103        DO_ICALL                                         $51     
        104        ASSIGN_OBJ                                               !0, 'maintitle'
        105        OP_DATA                                                  $51
   20   106    >   FETCH_OBJ_R                                      ~52     !0, 'maintitle'
        107        ECHO                                                     ~52
        108      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.2 ms | 1404 KiB | 19 Q