3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = '18/08/2014'; //$source = str_replace('/','-',$source); $date = new DateTime($source); echo $date->format('d.m.Y'); // 31.07.2012 echo ' - '.$date->format('d-m-Y'); // 31-07-2012
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NP6Q3
function name:  (null)
number of ops:  15
compiled vars:  !0 = $source, !1 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '18%2F08%2F2014'
    4     1        NEW                                              $3      'DateTime'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    5     5        INIT_METHOD_CALL                                         !1, 'format'
          6        SEND_VAL_EX                                              'd.m.Y'
          7        DO_FCALL                                      0  $6      
          8        ECHO                                                     $6
    6     9        INIT_METHOD_CALL                                         !1, 'format'
         10        SEND_VAL_EX                                              'd-m-Y'
         11        DO_FCALL                                      0  $7      
         12        CONCAT                                           ~8      '+-+', $7
         13        ECHO                                                     ~8
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.28 ms | 1392 KiB | 13 Q