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 { var_dump(explode('_', $filename)); $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/hGTUc
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'
   16     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'getdatefromfilename'
          4        SEND_VAR                                                 !1
          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/hGTUc
function name:  getDateFromFilename
number of ops:  32
compiled vars:  !0 = $filename, !1 = $timeslug
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '_'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
   12     8        INIT_FCALL                                               'implode'
          9        INIT_FCALL                                               'array_slice'
         10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '_'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $4      
         14        SEND_VAR                                                 $4
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 2
         17        DO_ICALL                                         $5      
         18        SEND_VAR                                                 $5
         19        DO_ICALL                                         $6      
         20        ASSIGN                                                   !1, $6
   13    21        INIT_FCALL                                               'date'
         22        SEND_VAL                                                 'c'
         23        INIT_FCALL                                               'strtotime'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $8      
         26        SEND_VAR                                                 $8
         27        DO_ICALL                                         $9      
         28        VERIFY_RETURN_TYPE                                       $9
         29      > RETURN                                                   $9
   14    30*       VERIFY_RETURN_TYPE                                       
         31*     > RETURN                                                   null

End of function getdatefromfilename

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.09 ms | 1403 KiB | 26 Q