3v4l.org

run code in 300+ PHP versions simultaneously
<?php function split_title($str){ return substr_replace(' ', '<span>', ceil((count_chars($str, 1)[32] + 1)/2), 1) . '</span>'; } echo split_title('This is a test!');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeDdR
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'split_title'
          1        SEND_VAL                                                 'This+is+a+test%21'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function split_title:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeDdR
function name:  split_title
number of ops:  20
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'substr_replace'
          2        SEND_VAL                                                 '+'
          3        SEND_VAL                                                 '%3Cspan%3E'
          4        INIT_FCALL                                               'ceil'
          5        INIT_FCALL                                               'count_chars'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $1      
          9        FETCH_DIM_R                                      ~2      $1, 32
         10        ADD                                              ~3      ~2, 1
         11        DIV                                              ~4      ~3, 2
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $6      
         17        CONCAT                                           ~7      $6, '%3C%2Fspan%3E'
         18      > RETURN                                                   ~7
    5    19*     > RETURN                                                   null

End of function split_title

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.45 ms | 1389 KiB | 20 Q