3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(string $timezone) { $ok = true; try { new DateTimeZone($timezone); } catch (Exception $e) { $ok = false; } echo "$timezone: ", var_export($ok, true), "\n"; } test('+01:00'); test('+01:00:00');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QpSln
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 '%2B01%3A00'
          2        DO_FCALL                                      0          
   16     3        INIT_FCALL                                               'test'
          4        SEND_VAL                                                 '%2B01%3A00%3A00'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QpSln
function name:  test
number of ops:  19
compiled vars:  !0 = $timezone, !1 = $ok, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <true>
    7     2        NEW                                              $4      'DateTimeZone'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        FREE                                                     $4
          6      > JMP                                                      ->9
    8     7  E > > CATCH                                       last         'Exception'
    9     8    >   ASSIGN                                                   !1, <false>
   12     9    >   NOP                                                      
         10        FAST_CONCAT                                      ~7      !0, '%3A+'
         11        ECHO                                                     ~7
         12        INIT_FCALL                                               'var_export'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $8      
         16        ECHO                                                     $8
         17        ECHO                                                     '%0A'
   13    18      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.37 ms | 1399 KiB | 17 Q