3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cookieExpireDays = 28; $expires = (new \DateTime('now'))->add(new \DateInterval(sprintf('P%sD', $cookieExpireDays))); var_dump($expires);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Hgi1
function name:  (null)
number of ops:  19
compiled vars:  !0 = $cookieExpireDays, !1 = $expires
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 28
    5     1        NEW                                              $3      'DateTime'
          2        SEND_VAL_EX                                              'now'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $3, 'add'
          5        NEW                                              $5      'DateInterval'
          6        INIT_FCALL                                               'sprintf'
          7        SEND_VAL                                                 'P%25sD'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
         10        SEND_VAR_NO_REF_EX                                       $6
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $5
         13        DO_FCALL                                      0  $8      
         14        ASSIGN                                                   !1, $8
    7    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.28 ms | 1386 KiB | 17 Q