3v4l.org

run code in 500+ 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 = 10
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 14
Branch analysis from position: 10
filename:       /in/8oHrq
function name:  (null)
number of ops:  23
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, ->10
          6    >   FRAMELESS_ICALL_3                strpos              ~9      !0, '+'
          7        OP_DATA                                                      170
          8        ASSIGN                                               ~10     !3, ~9
          9        BOOL                                                 ~8      ~10
         10    > > JMPZ_EX                                              ~8      ~8, ->14
         11    >   PRE_INC                                              ~11     !3
         12        IS_SMALLER                                           ~12     ~11, !2
         13        BOOL                                                 ~8      ~12
         14    > > JMPZ                                                         ~8, ->21
    5    15    >   INIT_FCALL                                                   'substr_replace'
         16        SEND_VAR                                                     !0
         17        SEND_VAR                                                     !1
         18        SEND_VAR                                                     !3
         19        DO_ICALL                                             $13     
         20        ASSIGN                                                       !0, $13
    7    21    >   ECHO                                                         !0
    8    22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.55 ms | 2620 KiB | 14 Q