3v4l.org

run code in 300+ PHP versions simultaneously
<?php $left = '0h : 59m : 0s'; $right = '0h : 30m : 0s'; $lookup = [ -1 => 'less', 0 => 'equal', 1 => 'more' ]; $format = '%dh : %dm : %ds'; $comparison = sscanf($left, $format) <=> sscanf($right, $format); echo $comparison . ' -> ' . $lookup[$comparison];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7ABl
function name:  (null)
number of ops:  19
compiled vars:  !0 = $left, !1 = $right, !2 = $lookup, !3 = $format, !4 = $comparison
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '0h+%3A+59m+%3A+0s'
    4     1        ASSIGN                                                   !1, '0h+%3A+30m+%3A+0s'
    6     2        ASSIGN                                                   !2, <array>
   12     3        ASSIGN                                                   !3, '%25dh+%3A+%25dm+%3A+%25ds'
   13     4        INIT_FCALL                                               'sscanf'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !3
          7        DO_ICALL                                         $9      
          8        INIT_FCALL                                               'sscanf'
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $10     
         12        SPACESHIP                                        ~11     $9, $10
         13        ASSIGN                                                   !4, ~11
   14    14        CONCAT                                           ~13     !4, '+-%3E+'
         15        FETCH_DIM_R                                      ~14     !2, !4
         16        CONCAT                                           ~15     ~13, ~14
         17        ECHO                                                     ~15
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.07 ms | 1004 KiB | 14 Q