3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename = 'myfile.php'; $dot_position = strrpos( $filename, '.' ) + 1; $ext = substr( $filename, $dot_position ); echo $ext; echo substr( $filename, 0, $dot_position );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/80RkT
function name:  (null)
number of ops:  20
compiled vars:  !0 = $filename, !1 = $dot_position, !2 = $ext
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'myfile.php'
    3     1        INIT_FCALL                                               'strrpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.'
          4        DO_ICALL                                         $4      
          5        ADD                                              ~5      $4, 1
          6        ASSIGN                                                   !1, ~5
    4     7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
    5    12        ECHO                                                     !2
    6    13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 0
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $9      
         18        ECHO                                                     $9
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.13 ms | 1394 KiB | 17 Q