3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filenameNew = 'PX20170713_103320_2651093_00001'; $filenameOld = '5956e5781e4f1-20170630_233347_5712837_00001'; $timeslug = implode(array_slice(explode('_', rtrim(basename($fileToProcess), ".xml" )), 0, 2)); $datetime = date('c', strtotime($timeslug)); function getDateFromFilename(string $filename): string { $timeslug = implode(array_slice(explode('_', $filename), 0, 2)); return date('c', strtotime($timeslug)); } var_dump(getDateFromFilename($filenameOld));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2u7sD
function name:  (null)
number of ops:  37
compiled vars:  !0 = $filenameNew, !1 = $filenameOld, !2 = $timeslug, !3 = $fileToProcess, !4 = $datetime
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'
    6     2        INIT_FCALL                                               'implode'
          3        INIT_FCALL                                               'array_slice'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '_'
          6        INIT_FCALL                                               'rtrim'
          7        INIT_FCALL                                               'basename'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        SEND_VAL                                                 '.xml'
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 2
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                         $11     
         21        ASSIGN                                                   !2, $11
    7    22        INIT_FCALL                                               'date'
         23        SEND_VAL                                                 'c'
         24        INIT_FCALL                                               'strtotime'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $13     
         27        SEND_VAR                                                 $13
         28        DO_ICALL                                         $14     
         29        ASSIGN                                                   !4, $14
   15    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'getdatefromfilename'
         32        SEND_VAR                                                 !1
         33        DO_FCALL                                      0  $16     
         34        SEND_VAR                                                 $16
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Function getdatefromfilename:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2u7sD
function name:  getDateFromFilename
number of ops:  25
compiled vars:  !0 = $filename, !1 = $timeslug
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'implode'
          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                                                 0
          9        SEND_VAL                                                 2
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        ASSIGN                                                   !1, $4
   12    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'c'
         16        INIT_FCALL                                               'strtotime'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $6      
         19        SEND_VAR                                                 $6
         20        DO_ICALL                                         $7      
         21        VERIFY_RETURN_TYPE                                       $7
         22      > RETURN                                                   $7
   13    23*       VERIFY_RETURN_TYPE                                       
         24*     > RETURN                                                   null

End of function getdatefromfilename

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.48 ms | 1394 KiB | 30 Q