3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filenameNew = 'PX20170713_103320_2651093_00001'; $filenameOld = '5956e5781e4f1-20170630_233347_5712837_00001.xml'; //$timeslug = implode(array_slice(explode('_', rtrim(basename($fileToProcess), ".xml" )), 0, 2)); //$datetime = date('c', strtotime($timeslug)); function getDateFromFilename(string $filename) { $filename = ltrim('PX', $filename); $parts = explode('_', $filename); return $parts; } var_dump(getDateFromFilename($filenameNew));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0n0fB
function name:  (null)
number of ops:  9
compiled vars:  !0 = $filenameNew, !1 = $filenameOld
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'PX20170713_103320_2651093_00001'
    4     1        ASSIGN                                                   !1, '5956e5781e4f1-20170630_233347_5712837_00001.xml'
   17     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'getdatefromfilename'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function getdatefromfilename:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0n0fB
function name:  getDateFromFilename
number of ops:  13
compiled vars:  !0 = $filename, !1 = $parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'ltrim'
          2        SEND_VAL                                                 'PX'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
   12     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '_'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $4      
         10        ASSIGN                                                   !1, $4
   14    11      > RETURN                                                   !1
   15    12*     > RETURN                                                   null

End of function getdatefromfilename

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.17 ms | 1397 KiB | 20 Q