3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sourceFormat = 'd-m-Y'; $targetFormat = 'Y-m-d'; $value = '22-11-2017'; $datetime = \DateTime::createFromFormat($sourceFormat, $value, new \DateTimeZone('UTC')); $targetFormat = str_replace('%e', date('j', $datetime->getTimestamp()), $targetFormat); $output = strftime($targetFormat, $datetime->getTimestamp()); var_dump($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TdOXM
function name:  (null)
number of ops:  35
compiled vars:  !0 = $sourceFormat, !1 = $targetFormat, !2 = $value, !3 = $datetime, !4 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'd-m-Y'
    4     1        ASSIGN                                                   !1, 'Y-m-d'
    6     2        ASSIGN                                                   !2, '22-11-2017'
    8     3        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        NEW                                              $8      'DateTimeZone'
          7        SEND_VAL_EX                                              'UTC'
          8        DO_FCALL                                      0          
          9        SEND_VAR                                                 $8
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !3, $10
    9    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAL                                                 '%25e'
         14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'j'
         16        INIT_METHOD_CALL                                         !3, 'getTimestamp'
         17        DO_FCALL                                      0  $12     
         18        SEND_VAR                                                 $12
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !1, $14
   10    24        INIT_FCALL                                               'strftime'
         25        SEND_VAR                                                 !1
         26        INIT_METHOD_CALL                                         !3, 'getTimestamp'
         27        DO_FCALL                                      0  $16     
         28        SEND_VAR                                                 $16
         29        DO_ICALL                                         $17     
         30        ASSIGN                                                   !4, $17
   12    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.67 ms | 1396 KiB | 21 Q