3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST['datebooking'] = (new \DateTime())->format('d-m-Y H:i:s'); $_POST['long'] = 6; $date_booking = \DateTime::createFromFormat('d-m-Y H:i:s', $_POST['datebooking']); echo "Booking starts at " . $date_booking->format('Y-m-d H:i:s') . "\n"; $long_time = new \DateInterval("PT{$_POST['long']}H"); $date_booking->add($long_time); echo "Booking ends at " . $date_booking->format('Y-m-d H:i:s');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Spft8
function name:  (null)
number of ops:  42
compiled vars:  !0 = $date_booking, !1 = $long_time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'DateTime'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $4, 'format'
          3        SEND_VAL_EX                                              'd-m-Y+H%3Ai%3As'
          4        DO_FCALL                                      0  $6      
          5        FETCH_W                      global              $2      '_POST'
          6        ASSIGN_DIM                                               $2, 'datebooking'
          7        OP_DATA                                                  $6
    3     8        FETCH_W                      global              $7      '_POST'
          9        ASSIGN_DIM                                               $7, 'long'
         10        OP_DATA                                                  6
    5    11        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         12        SEND_VAL                                                 'd-m-Y+H%3Ai%3As'
         13        FETCH_R                      global              ~9      '_POST'
         14        FETCH_DIM_R                                      ~10     ~9, 'datebooking'
         15        SEND_VAL                                                 ~10
         16        DO_FCALL                                      0  $11     
         17        ASSIGN                                                   !0, $11
    6    18        INIT_METHOD_CALL                                         !0, 'format'
         19        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         20        DO_FCALL                                      0  $13     
         21        CONCAT                                           ~14     'Booking+starts+at+', $13
         22        CONCAT                                           ~15     ~14, '%0A'
         23        ECHO                                                     ~15
    8    24        NEW                                              $16     'DateInterval'
         25        ROPE_INIT                                     3  ~20     'PT'
         26        FETCH_R                      global              ~17     '_POST'
         27        FETCH_DIM_R                                      ~18     ~17, 'long'
         28        ROPE_ADD                                      1  ~20     ~20, ~18
         29        ROPE_END                                      2  ~19     ~20, 'H'
         30        SEND_VAL_EX                                              ~19
         31        DO_FCALL                                      0          
         32        ASSIGN                                                   !1, $16
    9    33        INIT_METHOD_CALL                                         !0, 'add'
         34        SEND_VAR_EX                                              !1
         35        DO_FCALL                                      0          
   10    36        INIT_METHOD_CALL                                         !0, 'format'
         37        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         38        DO_FCALL                                      0  $25     
         39        CONCAT                                           ~26     'Booking+ends+at+', $25
         40        ECHO                                                     ~26
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.18 ms | 1395 KiB | 13 Q