3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_excerpt( $text, $length = 200, $append = '...' ) { if( strlen( $text ) < $length ) { return $text; } else { $excerpt = substr( $text, 0, $length ); $excerpt .= $append; return $excerpt; } } $rt = "hellokkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"; echo strln($rt); echo get_excerpt("") ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5pIoT
function name:  (null)
number of ops:  10
compiled vars:  !0 = $rt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'hellokkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'
   14     1        INIT_FCALL_BY_NAME                                       'strln'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   15     5        INIT_FCALL                                               'get_excerpt'
          6        SEND_VAL                                                 ''
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
   17     9      > RETURN                                                   1

Function get_excerpt:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5pIoT
function name:  get_excerpt
number of ops:  17
compiled vars:  !0 = $text, !1 = $length, !2 = $append, !3 = $excerpt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      200
          2        RECV_INIT                                        !2      '...'
    4     3        STRLEN                                           ~4      !0
          4        IS_SMALLER                                               ~4, !1
          5      > JMPZ                                                     ~5, ->8
    5     6    > > RETURN                                                   !0
          7*       JMP                                                      ->16
    8     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13        ASSIGN                                                   !3, $6
    9    14        ASSIGN_OP                                     8          !3, !2
   10    15      > RETURN                                                   !3
   12    16*     > RETURN                                                   null

End of function get_excerpt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184 ms | 1399 KiB | 16 Q