3v4l.org

run code in 300+ PHP versions simultaneously
<?php $postText = "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy."; $ellipsis = "...<a class='see-more' href='http://example.com/seemore-link'>read more</a>"; if (($len = strlen($postText)) > 170 && ($pos = strpos($postText, ' ', 170)) && ++$pos < $len){ $postText = substr_replace($postText, $ellipsis, $pos); } echo $postText;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 17
Branch analysis from position: 13
filename:       /in/8oHrq
function name:  (null)
number of ops:  26
compiled vars:  !0 = $postText, !1 = $ellipsis, !2 = $len, !3 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'It+is+a+long+established+fact+that+a+reader+will+be+distracted+by+the+readable+content+of+a+page+when+looking+at+its+layout.+The+point+of+using+Lorem+Ipsum+is+that+it+has+a+more-or-less+normal+distribution+of+letters%2C+as+opposed+to+using+%27Content+here%2C+content+here%27%2C+making+it+look+like+readable+English.+Many+desktop+publishing+packages+and+web+page+editors+now+use+Lorem+Ipsum+as+their+default+model+text%2C+and+a+search+for+%27lorem+ipsum%27+will+uncover+many+web+sites+still+in+their+infancy.'
    3     1        ASSIGN                                                   !1, '...%3Ca+class%3D%27see-more%27+href%3D%27http%3A%2F%2Fexample.com%2Fseemore-link%27%3Eread+more%3C%2Fa%3E'
    4     2        STRLEN                                           ~6      !0
          3        ASSIGN                                           ~7      !2, ~6
          4        IS_SMALLER                                       ~8      170, ~7
          5      > JMPZ_EX                                          ~8      ~8, ->13
          6    >   INIT_FCALL                                               'strpos'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '+'
          9        SEND_VAL                                                 170
         10        DO_ICALL                                         $9      
         11        ASSIGN                                           ~10     !3, $9
         12        BOOL                                             ~8      ~10
         13    > > JMPZ_EX                                          ~8      ~8, ->17
         14    >   PRE_INC                                          ~11     !3
         15        IS_SMALLER                                       ~12     ~11, !2
         16        BOOL                                             ~8      ~12
         17    > > JMPZ                                                     ~8, ->24
    5    18    >   INIT_FCALL                                               'substr_replace'
         19        SEND_VAR                                                 !0
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $13     
         23        ASSIGN                                                   !0, $13
    7    24    >   ECHO                                                     !0
    8    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.25 ms | 1000 KiB | 15 Q