3v4l.org

run code in 300+ PHP versions simultaneously
<?php $seg="20"; $horaActual=(new \DateTime())->format('Y-m-d H:i:s'); $horafinal = strtotime ( '-'.$seg.' second' , strtotime ( $horaActual ) ) ; $horafinal = date ( 'Y-m-d H:i:s' , $horafinal ); echo ($horaActual. PHP_EOL); echo ($horafinal. PHP_EOL); //print_r($horafinal); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2d7I3
function name:  (null)
number of ops:  27
compiled vars:  !0 = $seg, !1 = $horaActual, !2 = $horafinal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '20'
    4     1        NEW                                              $4      'DateTime'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $4, 'format'
          4        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !1, $6
    9     7        INIT_FCALL                                               'strtotime'
          8        CONCAT                                           ~8      '-', !0
          9        CONCAT                                           ~9      ~8, '+second'
         10        SEND_VAL                                                 ~9
         11        INIT_FCALL                                               'strtotime'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !2, $11
   11    17        INIT_FCALL                                               'date'
         18        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !2, $13
   13    22        CONCAT                                           ~15     !1, '%0A'
         23        ECHO                                                     ~15
   14    24        CONCAT                                           ~16     !2, '%0A'
         25        ECHO                                                     ~16
   18    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.16 ms | 1395 KiB | 17 Q