3v4l.org

run code in 300+ PHP versions simultaneously
<?php function from_12hr($time) { return DateTime::createFromFormat('h:i A T', $time . ' UTC')->format('H:i'); } var_dump(from_12hr('00:00 AM'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c6dTF
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'from_12hr'
          2        SEND_VAL                                                 '00%3A00+AM'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function from_12hr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c6dTF
function name:  from_12hr
number of ops:  11
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'h%3Ai+A+T'
          3        CONCAT                                           ~1      !0, '+UTC'
          4        SEND_VAL                                                 ~1
          5        DO_FCALL                                      0  $2      
          6        INIT_METHOD_CALL                                         $2, 'format'
          7        SEND_VAL_EX                                              'H%3Ai'
          8        DO_FCALL                                      0  $3      
          9      > RETURN                                                   $3
    6    10*     > RETURN                                                   null

End of function from_12hr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.71 ms | 1004 KiB | 15 Q