3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!function_exists(cutstringgf)) { function cutstringgf($stranb, $lengthanb, $theend = "... ") { $stranb = strip_tags($stranb); if (strlen($stranb) > 80) { $text2 = substr($stranb, 0, $lengthanb); $words = explode(" ", $text2); $words = array_reverse($words); array_splice($words, 0, 1); $alexxnb = 0; for ($i = 0; $i < count($words); $i++) { $i = $i - $alexxnb; if (substr($words[$i], - 1) == "," or substr($words[$i], - 1) == "." or substr($words[$i], - 1) == ":" or substr($words[$i], - 1) == ";") { $words[$i] = substr($words[$i], 0, strlen($words[$i]) - 1); } ; $wrd = $words[$i]; if (strlen($wrd) < 4) { array_splice($words, $i, 1); $alexxnb = 1; } else { $i = 1985; } ; } ; $mwords = ""; $words = array_reverse($words); for ($i = 0; $i < count($words); $i++) { $mwords = $mwords . $words[$i]; if ($i != count($words) - 1) { $mwords = $mwords . " "; } else { $mwords = $mwords . $theend; } ; } ; } else { $mwords = $stranb; } echo $mwords; } } $txt = $modx->getDocument($iddoc); $source = '<p>Seth Kimbrough стал совсем модненьким, знатоки помнят с каких "диванов" он начинал. Приятно смотреть на его катание в любом обличии. Катается не в напряг и это чувствуется после просмотра любого видео. Эта реклама <a title="shadow" href="brands/shadow_conspiracy_bmx.html" target="_blank">Shadow</a> - не исключение. Здорово!</p> <p>&nbsp;</p>'; echo cutstringgf(stripslashes(preg_replace("/<img(.*?)\>/", "", preg_replace('/<span[^>]*>(.*)<\/span>/Ui', '\\1', $source))), 350); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/tikQK
function name:  (null)
number of ops:  31
compiled vars:  !0 = $txt, !1 = $modx, !2 = $iddoc, !3 = $source
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'function_exists'
          1        FETCH_CONSTANT                                   ~4      'cutstringgf'
          2        SEND_VAL                                                 ~4
          3        DO_ICALL                                         $5      
          4        BOOL_NOT                                         ~6      $5
          5      > JMPZ                                                     ~6, ->7
    4     6    >   DECLARE_FUNCTION                                         'cutstringgf'
   54     7    >   INIT_METHOD_CALL                                         !1, 'getDocument'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !0, $7
   56    11        ASSIGN                                                   !3, '%3Cp%3ESeth+Kimbrough+%D1%81%D1%82%D0%B0%D0%BB+%D1%81%D0%BE%D0%B2%D1%81%D0%B5%D0%BC+%D0%BC%D0%BE%D0%B4%D0%BD%D0%B5%D0%BD%D1%8C%D0%BA%D0%B8%D0%BC%2C+%D0%B7%D0%BD%D0%B0%D1%82%D0%BE%D0%BA%D0%B8+%D0%BF%D0%BE%D0%BC%D0%BD%D1%8F%D1%82+%D1%81+%D0%BA%D0%B0%D0%BA%D0%B8%D1%85+%22%D0%B4%D0%B8%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%22+%D0%BE%D0%BD+%D0%BD%D0%B0%D1%87%D0%B8%D0%BD%D0%B0%D0%BB.+%D0%9F%D1%80%D0%B8%D1%8F%D1%82%D0%BD%D0%BE+%D1%81%D0%BC%D0%BE%D1%82%D1%80%D0%B5%D1%82%D1%8C+%D0%BD%D0%B0+%D0%B5%D0%B3%D0%BE+%D0%BA%D0%B0%D1%82%D0%B0%D0%BD%D0%B8%D0%B5+%D0%B2+%D0%BB%D1%8E%D0%B1%D0%BE%D0%BC+%D0%BE%D0%B1%D0%BB%D0%B8%D1%87%D0%B8%D0%B8.+%D0%9A%D0%B0%D1%82%D0%B0%D0%B5%D1%82%D1%81%D1%8F+%D0%BD%D0%B5+%D0%B2+%D0%BD%D0%B0%D0%BF%D1%80%D1%8F%D0%B3+%D0%B8+%D1%8D%D1%82%D0%BE+%D1%87%D1%83%D0%B2%D1%81%D1%82%D0%B2%D1%83%D0%B5%D1%82%D1%81%D1%8F+%D0%BF%D0%BE%D1%81%D0%BB%D0%B5+%D0%BF%D1%80%D0%BE%D1%81%D0%BC%D0%BE%D1%82%D1%80%D0%B0+%D0%BB%D1%8E%D0%B1%D0%BE%D0%B3%D0%BE+%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE.+%D0%AD%D1%82%D0%B0+%D1%80%D0%B5%D0%BA%D0%BB%D0%B0%D0%BC%D0%B0+%3Ca+title%3D%22shadow%22+href%3D%22brands%2Fshadow_conspiracy_bmx.html%22+target%3D%22_blank%22%3EShadow%3C%2Fa%3E+-+%D0%BD%D0%B5+%D0%B8%D1%81%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5.+%D0%97%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%BE%21%3C%2Fp%3E%0A%3Cp%3E%26nbsp%3B%3C%2Fp%3E'
   59    12        INIT_FCALL_BY_NAME                                       'cutstringgf'
         13        INIT_FCALL                                               'stripslashes'
         14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2F%3Cimg%28.%2A%3F%29%5C%3E%2F'
         16        SEND_VAL                                                 ''
         17        INIT_FCALL                                               'preg_replace'
         18        SEND_VAL                                                 '%2F%3Cspan%5B%5E%3E%5D%2A%3E%28.%2A%29%3C%5C%2Fspan%3E%2FUi'
         19        SEND_VAL                                                 '%5C1'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        DO_ICALL                                         $11     
         24        SEND_VAR                                                 $11
         25        DO_ICALL                                         $12     
         26        SEND_VAR_NO_REF_EX                                       $12
         27        SEND_VAL_EX                                              350
         28        DO_FCALL                                      0  $13     
         29        ECHO                                                     $13
   60    30      > RETURN                                                   1

Function %00cutstringgf%2Fin%2FtikQK%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 118
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 91
Branch analysis from position: 91
2 jumps found. (Code = 44) Position 1 = 94, Position 2 = 33
Branch analysis from position: 94
1 jumps found. (Code = 42) Position 1 = 114
Branch analysis from position: 114
2 jumps found. (Code = 44) Position 1 = 117, Position 2 = 101
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 119
Branch analysis from position: 119
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 101
2 jumps found. (Code = 43) Position 1 = 108, Position 2 = 111
Branch analysis from position: 108
1 jumps found. (Code = 42) Position 1 = 113
Branch analysis from position: 113
2 jumps found. (Code = 44) Position 1 = 117, Position 2 = 101
Branch analysis from position: 117
Branch analysis from position: 101
Branch analysis from position: 111
2 jumps found. (Code = 44) Position 1 = 117, Position 2 = 101
Branch analysis from position: 117
Branch analysis from position: 101
Branch analysis from position: 33
2 jumps found. (Code = 47) Position 1 = 42, Position 2 = 49
Branch analysis from position: 42
2 jumps found. (Code = 47) Position 1 = 50, Position 2 = 57
Branch analysis from position: 50
2 jumps found. (Code = 47) Position 1 = 58, Position 2 = 65
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 77
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 89
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 94, Position 2 = 33
Branch analysis from position: 94
Branch analysis from position: 33
Branch analysis from position: 89
2 jumps found. (Code = 44) Position 1 = 94, Position 2 = 33
Branch analysis from position: 94
Branch analysis from position: 33
Branch analysis from position: 77
Branch analysis from position: 65
Branch analysis from position: 57
Branch analysis from position: 49
Branch analysis from position: 118
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tikQK
function name:  cutstringgf
number of ops:  121
compiled vars:  !0 = $stranb, !1 = $lengthanb, !2 = $theend, !3 = $text2, !4 = $words, !5 = $alexxnb, !6 = $i, !7 = $wrd, !8 = $mwords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      '...+'
    5     3        INIT_FCALL                                               'strip_tags'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !0, $9
    7     7        STRLEN                                           ~11     !0
          8        IS_SMALLER                                               80, ~11
          9      > JMPZ                                                     ~12, ->118
    8    10    >   INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !3, $13
    9    16        INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '+'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !4, $15
   10    21        INIT_FCALL                                               'array_reverse'
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $17     
         24        ASSIGN                                                   !4, $17
   11    25        INIT_FCALL                                               'array_splice'
         26        SEND_REF                                                 !4
         27        SEND_VAL                                                 0
         28        SEND_VAL                                                 1
         29        DO_ICALL                                                 
   12    30        ASSIGN                                                   !5, 0
   13    31        ASSIGN                                                   !6, 0
         32      > JMP                                                      ->91
   14    33    >   SUB                                              ~22     !6, !5
         34        ASSIGN                                                   !6, ~22
   16    35        INIT_FCALL                                               'substr'
         36        FETCH_DIM_R                                      ~24     !4, !6
         37        SEND_VAL                                                 ~24
         38        SEND_VAL                                                 -1
         39        DO_ICALL                                         $25     
         40        IS_EQUAL                                         ~26     $25, '%2C'
         41      > JMPNZ_EX                                         ~26     ~26, ->49
         42    >   INIT_FCALL                                               'substr'
         43        FETCH_DIM_R                                      ~27     !4, !6
         44        SEND_VAL                                                 ~27
         45        SEND_VAL                                                 -1
         46        DO_ICALL                                         $28     
         47        IS_EQUAL                                         ~29     $28, '.'
         48        BOOL                                             ~26     ~29
         49    > > JMPNZ_EX                                         ~26     ~26, ->57
         50    >   INIT_FCALL                                               'substr'
         51        FETCH_DIM_R                                      ~30     !4, !6
         52        SEND_VAL                                                 ~30
         53        SEND_VAL                                                 -1
         54        DO_ICALL                                         $31     
         55        IS_EQUAL                                         ~32     $31, '%3A'
         56        BOOL                                             ~26     ~32
         57    > > JMPNZ_EX                                         ~26     ~26, ->65
         58    >   INIT_FCALL                                               'substr'
         59        FETCH_DIM_R                                      ~33     !4, !6
         60        SEND_VAL                                                 ~33
         61        SEND_VAL                                                 -1
         62        DO_ICALL                                         $34     
         63        IS_EQUAL                                         ~35     $34, '%3B'
         64        BOOL                                             ~26     ~35
         65    > > JMPZ                                                     ~26, ->77
   17    66    >   INIT_FCALL                                               'substr'
         67        FETCH_DIM_R                                      ~37     !4, !6
         68        SEND_VAL                                                 ~37
         69        SEND_VAL                                                 0
         70        FETCH_DIM_R                                      ~38     !4, !6
         71        STRLEN                                           ~39     ~38
         72        SUB                                              ~40     ~39, 1
         73        SEND_VAL                                                 ~40
         74        DO_ICALL                                         $41     
         75        ASSIGN_DIM                                               !4, !6
         76        OP_DATA                                                  $41
   20    77    >   FETCH_DIM_R                                      ~42     !4, !6
         78        ASSIGN                                                   !7, ~42
   22    79        STRLEN                                           ~44     !7
         80        IS_SMALLER                                               ~44, 4
         81      > JMPZ                                                     ~45, ->89
   23    82    >   INIT_FCALL                                               'array_splice'
         83        SEND_REF                                                 !4
         84        SEND_VAR                                                 !6
         85        SEND_VAL                                                 1
         86        DO_ICALL                                                 
   24    87        ASSIGN                                                   !5, 1
         88      > JMP                                                      ->90
   27    89    >   ASSIGN                                                   !6, 1985
   13    90    >   PRE_INC                                                  !6
         91    >   COUNT                                            ~50     !4
         92        IS_SMALLER                                               !6, ~50
         93      > JMPNZ                                                    ~51, ->33
   32    94    >   ASSIGN                                                   !8, ''
   33    95        INIT_FCALL                                               'array_reverse'
         96        SEND_VAR                                                 !4
         97        DO_ICALL                                         $53     
         98        ASSIGN                                                   !4, $53
   34    99        ASSIGN                                                   !6, 0
        100      > JMP                                                      ->114
   35   101    >   FETCH_DIM_R                                      ~56     !4, !6
        102        CONCAT                                           ~57     !8, ~56
        103        ASSIGN                                                   !8, ~57
   37   104        COUNT                                            ~59     !4
        105        SUB                                              ~60     ~59, 1
        106        IS_NOT_EQUAL                                             !6, ~60
        107      > JMPZ                                                     ~61, ->111
   38   108    >   CONCAT                                           ~62     !8, '+'
        109        ASSIGN                                                   !8, ~62
        110      > JMP                                                      ->113
   41   111    >   CONCAT                                           ~64     !8, !2
        112        ASSIGN                                                   !8, ~64
   34   113    >   PRE_INC                                                  !6
        114    >   COUNT                                            ~67     !4
        115        IS_SMALLER                                               !6, ~67
        116      > JMPNZ                                                    ~68, ->101
        117    > > JMP                                                      ->119
   48   118    >   ASSIGN                                                   !8, !0
   50   119    >   ECHO                                                     !8
   51   120      > RETURN                                                   null

End of function %00cutstringgf%2Fin%2FtikQK%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.46 ms | 1412 KiB | 29 Q