3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = '#62 Tom Hendry Warehouse'; echo substr( $var, 0, strpos( $var, ' ', 0 ) ); echo "\n"; echo rtrim( $var, ' ' ); echo "\n"; preg_match("/^[#]+[\d]+[\s]/", $var, $match ); echo "\n"; echo ltrim( $match[0], "#" );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kvrSD
function name:  (null)
number of ops:  32
compiled vars:  !0 = $var, !1 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2362+Tom+Hendry+Warehouse'
    3     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '+'
          7        SEND_VAL                                                 0
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                         $4      
         11        ECHO                                                     $4
    4    12        ECHO                                                     '%0A'
    5    13        INIT_FCALL                                               'rtrim'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '+'
         16        DO_ICALL                                         $5      
         17        ECHO                                                     $5
    6    18        ECHO                                                     '%0A'
    7    19        INIT_FCALL                                               'preg_match'
         20        SEND_VAL                                                 '%2F%5E%5B%23%5D%2B%5B%5Cd%5D%2B%5B%5Cs%5D%2F'
         21        SEND_VAR                                                 !0
         22        SEND_REF                                                 !1
         23        DO_ICALL                                                 
    8    24        ECHO                                                     '%0A'
    9    25        INIT_FCALL                                               'ltrim'
         26        FETCH_DIM_R                                      ~7      !1, 0
         27        SEND_VAL                                                 ~7
         28        SEND_VAL                                                 '%23'
         29        DO_ICALL                                         $8      
         30        ECHO                                                     $8
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.49 ms | 940 KiB | 24 Q