3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a( $fileName ) { $fileName = rtrim( $fileName, '. ' ); if ( false !== ( $pos = strrpos( $fileName, '.' ) ) ) { return substr( $fileName, $pos + 1 ); } return ''; } var_dump( a( 'VPN_CONFIG.bmp' ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YI7A2
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'a'
          2        SEND_VAL                                                 'VPN_CONFIG.bmp'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YI7A2
function name:  a
number of ops:  21
compiled vars:  !0 = $fileName, !1 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'rtrim'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.+'
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
    6     6        INIT_FCALL                                               'strrpos'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '.'
          9        DO_ICALL                                         $4      
         10        ASSIGN                                           ~5      !1, $4
         11        TYPE_CHECK                                  1018          ~5
         12      > JMPZ                                                     ~6, ->19
    8    13    >   INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        ADD                                              ~7      !1, 1
         16        SEND_VAL                                                 ~7
         17        DO_ICALL                                         $8      
         18      > RETURN                                                   $8
   11    19    > > RETURN                                                   ''
   12    20*     > RETURN                                                   null

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.53 ms | 1390 KiB | 22 Q