3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = '1d 0h 16m 2s'; sscanf($input, '%dd %dh %dm %ds', $d, $h, $m, $s); echo "$input = " . $d * 86400 + $h * 3600 + $m * 60 + $s . " seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6KaXY
function name:  (null)
number of ops:  21
compiled vars:  !0 = $input, !1 = $d, !2 = $h, !3 = $m, !4 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1d+0h+16m+2s'
    4     1        INIT_FCALL                                                   'sscanf'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     '%25dd+%25dh+%25dm+%25ds'
          4        SEND_REF                                                     !1
          5        SEND_REF                                                     !2
          6        SEND_REF                                                     !3
          7        SEND_REF                                                     !4
          8        DO_ICALL                                                     
    5     9        NOP                                                          
         10        FAST_CONCAT                                          ~7      !0, '+%3D+'
         11        MUL                                                  ~8      !1, 86400
         12        MUL                                                  ~9      !2, 3600
         13        ADD                                                  ~10     ~8, ~9
         14        MUL                                                  ~11     !3, 60
         15        ADD                                                  ~12     ~10, ~11
         16        ADD                                                  ~13     ~12, !4
         17        CONCAT                                               ~14     ~7, ~13
         18        CONCAT                                               ~15     ~14, '+seconds%0A'
         19        ECHO                                                         ~15
         20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.79 ms | 1754 KiB | 14 Q