3v4l.org

run code in 300+ PHP versions simultaneously
<?php function normalise($string) { preg_match('~[a-z0-9]+$~i', $string, $match); if ( ! isset($match[0])) { return false; } return strtoupper($match[0]); } echo normalise('Deu-12345tx'), PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hVMZU
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'normalise'
          1        SEND_VAL                                                 'Deu-12345tx'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4        ECHO                                                     '%0A'
          5      > RETURN                                                   1

Function normalise:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hVMZU
function name:  normalise
number of ops:  16
compiled vars:  !0 = $string, !1 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%5Ba-z0-9%5D%2B%24%7Ei'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    6     6        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !1, 0
          7        BOOL_NOT                                         ~4      ~3
          8      > JMPZ                                                     ~4, ->10
    7     9    > > RETURN                                                   <false>
   10    10    >   INIT_FCALL                                               'strtoupper'
         11        FETCH_DIM_R                                      ~5      !1, 0
         12        SEND_VAL                                                 ~5
         13        DO_ICALL                                         $6      
         14      > RETURN                                                   $6
   11    15*     > RETURN                                                   null

End of function normalise

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.15 ms | 1398 KiB | 18 Q