3v4l.org

run code in 300+ PHP versions simultaneously
<?php function extension($str){ $str=implode("",explode("\\",$str)); $str=explode(".",$str); $str=strtolower(end($str)); return $str; } // EXAMPLE: $file='name-Of_soMe.File.txt'; echo extension($file); // txt ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fIkQJ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'name-Of_soMe.File.txt'
   11     1        INIT_FCALL                                               'extension'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   12     5      > RETURN                                                   1

Function extension:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fIkQJ
function name:  extension
number of ops:  24
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%5C'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9        ASSIGN                                                   !0, $2
    4    10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '.'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $4      
         14        ASSIGN                                                   !0, $4
    5    15        INIT_FCALL                                               'strtolower'
         16        INIT_FCALL                                               'end'
         17        SEND_REF                                                 !0
         18        DO_ICALL                                         $6      
         19        SEND_VAR                                                 $6
         20        DO_ICALL                                         $7      
         21        ASSIGN                                                   !0, $7
    6    22      > RETURN                                                   !0
    7    23*     > RETURN                                                   null

End of function extension

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.63 ms | 1399 KiB | 22 Q