3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldtime = "20:30pm - 23:30pm"; $newtime = explode("-", $oldtime ); $arrStr = []; $arrObj = []; foreach($newtime as $elem) { $o = DateTime::CreateFromformat( 'H:i+',trim($elem) ); $arrObj[] = $o; $arrStr[] = $o->format('g:iA'); } echo join(" - ",$arrStr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 26
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 26
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/WIoE8
function name:  (null)
number of ops:  33
compiled vars:  !0 = $oldtime, !1 = $newtime, !2 = $arrStr, !3 = $arrObj, !4 = $elem, !5 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '20%3A30pm+-+23%3A30pm'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    6     6        ASSIGN                                                   !2, <array>
    7     7        ASSIGN                                                   !3, <array>
    9     8      > FE_RESET_R                                       $11     !1, ->26
          9    > > FE_FETCH_R                                               $11, !4, ->26
   11    10    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'CreateFromformat'
         11        SEND_VAL                                                 'H%3Ai%2B'
         12        INIT_FCALL                                               'trim'
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $12     
         15        SEND_VAR                                                 $12
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !5, $13
   12    18        ASSIGN_DIM                                               !3
         19        OP_DATA                                                  !5
   13    20        INIT_METHOD_CALL                                         !5, 'format'
         21        SEND_VAL_EX                                              'g%3AiA'
         22        DO_FCALL                                      0  $17     
         23        ASSIGN_DIM                                               !2
         24        OP_DATA                                                  $17
    9    25      > JMP                                                      ->9
         26    >   FE_FREE                                                  $11
   16    27        INIT_FCALL                                               'join'
         28        SEND_VAL                                                 '+-+'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $18     
         31        ECHO                                                     $18
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.98 ms | 1396 KiB | 19 Q