3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = parse_url('http://www.mywebsite/456754567/531613490.htm?menu=contact', PHP_URL_PATH); $pathParts = explode('/', $parts); $fullFilename = array_pop($pathParts); // probably use something like lastIndexOf() $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/O8gs6
function name:  (null)
number of ops:  28
compiled vars:  !0 = $path, !1 = $pathParts, !2 = $parts, !3 = $fullFilename, !4 = $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                                         $5      
          4        ASSIGN                                                   !0, $5
    4     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2F'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !1, $7
    5    10        INIT_FCALL                                               'array_pop'
         11        SEND_REF                                                 !1
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
    8    14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !3
         16        SEND_VAL                                                 0
         17        INIT_FCALL                                               'strpos'
         18        SEND_VAR                                                 !3
         19        SEND_VAL                                                 '.'
         20        DO_ICALL                                         $11     
         21        SEND_VAR                                                 $11
         22        DO_ICALL                                         $12     
         23        ASSIGN                                                   !4, $12
    9    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.11 ms | 1395 KiB | 25 Q