3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text ='12345 12345 12345 4'; $cut_text=trim(mb_substr($text,0,mb_strrpos(mb_substr($text,0,5,'utf-8'),' ',utf-8),'utf-8'), '\,'); echo $cut_text;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dlfHK
function name:  (null)
number of ops:  27
compiled vars:  !0 = $text, !1 = $cut_text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '12345+12345+12345+4'
    3     1        INIT_FCALL                                               'trim'
          2        INIT_FCALL                                               'mb_substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        INIT_FCALL                                               'mb_strrpos'
          6        INIT_FCALL                                               'mb_substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 5
         10        SEND_VAL                                                 'utf-8'
         11        DO_ICALL                                         $3      
         12        SEND_VAR                                                 $3
         13        SEND_VAL                                                 '+'
         14        FETCH_CONSTANT                                   ~4      'utf'
         15        SUB                                              ~5      ~4, 8
         16        SEND_VAL                                                 ~5
         17        DO_ICALL                                         $6      
         18        SEND_VAR                                                 $6
         19        SEND_VAL                                                 'utf-8'
         20        DO_ICALL                                         $7      
         21        SEND_VAR                                                 $7
         22        SEND_VAL                                                 '%5C%2C'
         23        DO_ICALL                                         $8      
         24        ASSIGN                                                   !1, $8
    5    25        ECHO                                                     !1
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.03 ms | 1395 KiB | 19 Q