3v4l.org

run code in 500+ PHP versions simultaneously
<?php $ranges = [ ['from' => '9:00', 'to' => '9:45'], ['from' => '9:55', 'to' => '10:20'], ['from' => '10:30', 'to' => '11:00'], ]; if (!isset($ranges[0]['from'], $ranges[0]['to'])) { throw new Exception('insufficient business hours data'); } printf('Open hours today: %s - %s', $ranges[0]['from'], $ranges[array_key_last($ranges)]['to']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/7BS1d
function name:  (null)
number of ops:  26
compiled vars:  !0 = $ranges
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        FETCH_DIM_IS                                         ~2      !0, 0
          2        ISSET_ISEMPTY_DIM_OBJ                             0  ~3      ~2, 'from'
          3      > JMPZ_EX                                              ~3      ~3, ->7
          4    >   FETCH_DIM_IS                                         ~4      !0, 0
          5        ISSET_ISEMPTY_DIM_OBJ                             0  ~5      ~4, 'to'
          6        BOOL                                                 ~3      ~5
          7    >   BOOL_NOT                                             ~6      ~3
          8      > JMPZ                                                         ~6, ->13
   10     9    >   NEW                                                  $7      'Exception'
         10        SEND_VAL_EX                                                  'insufficient+business+hours+data'
         11        DO_FCALL                                          0          
         12      > THROW                                             0          $7
   12    13    >   INIT_FCALL                                                   'printf'
         14        SEND_VAL                                                     'Open+hours+today%3A+%25s+-+%25s'
         15        FETCH_DIM_R                                          ~9      !0, 0
         16        FETCH_DIM_R                                          ~10     ~9, 'from'
         17        SEND_VAL                                                     ~10
         18        INIT_FCALL                                                   'array_key_last'
         19        SEND_VAR                                                     !0
         20        DO_ICALL                                             $11     
         21        FETCH_DIM_R                                          ~12     !0, $11
         22        FETCH_DIM_R                                          ~13     ~12, 'to'
         23        SEND_VAL                                                     ~13
         24        DO_ICALL                                                     
         25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.01 ms | 2019 KiB | 15 Q