3v4l.org

run code in 300+ PHP versions simultaneously
<?php $parts = parse_url('http://www.mywebsite/456754567/531613490.htm?menu=contact', PHP_URL_PATH); $fullFilename = explode('/', $parts)[2]; // this gives 531....htm $filename = substr($fullFilename, 0, strpos($fullFilename, '.')); var_dump( $filename );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dcu2T
function name:  (null)
number of ops:  25
compiled vars:  !0 = $parts, !1 = $fullFilename, !2 = $filename
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'parse_url'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.mywebsite%2F456754567%2F531613490.htm%3Fmenu%3Dcontact'
          2        SEND_VAL                                                 5
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2F'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        FETCH_DIM_R                                      ~6      $5, 2
         10        ASSIGN                                                   !1, ~6
    6    11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 0
         14        INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 '.'
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                         $9      
         20        ASSIGN                                                   !2, $9
    7    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1395 KiB | 23 Q