3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * @param String $dateString * @return DateTime */ function updateDate($dateString){ $suppliedDate = new \DateTime($dateString); $currentYear = (int)(new \DateTime())->format('Y'); return (new \DateTime())->setDate($currentYear, (int)$suppliedDate->format('m'), (int)$suppliedDate->format('d')); } var_dump(updateDate('8th August 2011'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gbbjv
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'updatedate'
          2        SEND_VAL                                                     '8th+August+2011'
          3        DO_FCALL                                          0  $0      
          4        SEND_VAR                                                     $0
          5        DO_ICALL                                                     
          6      > RETURN                                                       1

Function updatedate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gbbjv
function name:  updateDate
number of ops:  29
compiled vars:  !0 = $dateString, !1 = $suppliedDate, !2 = $currentYear
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        NEW                                                  $3      'DateTime'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $3
    8     5        NEW                                                  $6      'DateTime'
          6        DO_FCALL                                          0          
          7        INIT_METHOD_CALL                                             $6, 'format'
          8        SEND_VAL_EX                                                  'Y'
          9        DO_FCALL                                          0  $8      
         10        CAST                                              4  ~9      $8
         11        ASSIGN                                                       !2, ~9
    9    12        NEW                                                  $11     'DateTime'
         13        DO_FCALL                                          0          
         14        INIT_METHOD_CALL                                             $11, 'setDate'
         15        SEND_VAR_EX                                                  !2
         16        INIT_METHOD_CALL                                             !1, 'format'
         17        SEND_VAL_EX                                                  'm'
         18        DO_FCALL                                          0  $13     
         19        CAST                                              4  ~14     $13
         20        SEND_VAL_EX                                                  ~14
         21        INIT_METHOD_CALL                                             !1, 'format'
         22        SEND_VAL_EX                                                  'd'
         23        DO_FCALL                                          0  $15     
         24        CAST                                              4  ~16     $15
         25        SEND_VAL_EX                                                  ~16
         26        DO_FCALL                                          0  $17     
         27      > RETURN                                                       $17
   10    28*     > RETURN                                                       null

End of function updatedate

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.55 ms | 3135 KiB | 15 Q