3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://something.example.com/blah/filename.jpg'; var_dump( array_slice(explode('.', $url), -1)[0] ); var_dump(end(explode('.', $url)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bFDvA
function name:  (null)
number of ops:  24
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fsomething.example.com%2Fblah%2Ffilename.jpg'
    4     1        INIT_FCALL                                               'var_dump'
    5     2        INIT_FCALL                                               'array_slice'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '.'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        SEND_VAL                                                 -1
          9        DO_ICALL                                         $3      
         10        FETCH_DIM_R                                      ~4      $3, 0
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'end'
         15        INIT_FCALL                                               'explode'
         16        SEND_VAL                                                 '.'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $6      
         19        SEND_VAR_NO_REF                               0          $6
         20        DO_ICALL                                         $7      
         21        SEND_VAR                                                 $7
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.46 ms | 1395 KiB | 21 Q