3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str_time = "2:50"; sscanf($str_time, "%d:%d:%d", $hours, $minutes, $seconds); $time_seconds = isset($seconds) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes; echo $time_seconds;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kMLAf
function name:  (null)
number of ops:  22
compiled vars:  !0 = $str_time, !1 = $hours, !2 = $minutes, !3 = $seconds, !4 = $time_seconds
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2%3A50'
    5     1        INIT_FCALL                                               'sscanf'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%25d%3A%25d%3A%25d'
          4        SEND_REF                                                 !1
          5        SEND_REF                                                 !2
          6        SEND_REF                                                 !3
          7        DO_ICALL                                                 
    7     8        ISSET_ISEMPTY_CV                                         !3
          9      > JMPZ                                                     ~7, ->16
         10    >   MUL                                              ~8      !1, 3600
         11        MUL                                              ~9      !2, 60
         12        ADD                                              ~10     ~8, ~9
         13        ADD                                              ~11     ~10, !3
         14        QM_ASSIGN                                        ~12     ~11
         15      > JMP                                                      ->19
         16    >   MUL                                              ~13     !1, 60
         17        ADD                                              ~14     ~13, !2
         18        QM_ASSIGN                                        ~12     ~14
         19    >   ASSIGN                                                   !4, ~12
    8    20        ECHO                                                     !4
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.27 ms | 1399 KiB | 15 Q