3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale (LC_ALL, 'pt_BR'); // Try to create the datetime instance if ($date=DateTime::createFromFormat("d-M-y",strftime("%d-%b-%y","09-mai-17"))){ echo date_format($date,"Y/m/d"); } else { // It failed! Errors found, let's figure out what! echo "<pre>"; print_r(date_get_last_errors()); echo "</pre>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HRb0K
function name:  (null)
number of ops:  28
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'setlocale'
          1        SEND_VAL                                                 6
          2        SEND_VAL                                                 'pt_BR'
          3        DO_ICALL                                                 
    5     4        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          5        SEND_VAL                                                 'd-M-y'
          6        INIT_FCALL                                               'strftime'
          7        SEND_VAL                                                 '%25d-%25b-%25y'
          8        SEND_VAL                                                 '09-mai-17'
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_FCALL                                      0  $3      
         12        ASSIGN                                           ~4      !0, $3
         13      > JMPZ                                                     ~4, ->20
    6    14    >   INIT_FCALL                                               'date_format'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 'Y%2Fm%2Fd'
         17        DO_ICALL                                         $5      
         18        ECHO                                                     $5
         19      > JMP                                                      ->27
   10    20    >   ECHO                                                     '%3Cpre%3E'
   11    21        INIT_FCALL                                               'print_r'
         22        INIT_FCALL                                               'date_get_last_errors'
         23        DO_ICALL                                         $6      
         24        SEND_VAR                                                 $6
         25        DO_ICALL                                                 
   12    26        ECHO                                                     '%3C%2Fpre%3E'
   13    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.22 ms | 1395 KiB | 23 Q