3v4l.org

run code in 300+ PHP versions simultaneously
<?php $left = '6h : 27m : 5s'; $right = '6h : 27m : 15s'; $lookup = [ -1 => 'less', 0 => 'equal', 1 => 'more' ]; $lArray = preg_split('/\D+/', $left, 0, PREG_SPLIT_NO_EMPTY); $rArray = preg_split('/\D+/', $right, 0, PREG_SPLIT_NO_EMPTY); $comparison = $lArray <=> $rArray; echo $comparison . ' -> ' . $lookup[$comparison];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iQc0B
function name:  (null)
number of ops:  24
compiled vars:  !0 = $left, !1 = $right, !2 = $lookup, !3 = $lArray, !4 = $rArray, !5 = $comparison
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '6h+%3A+27m+%3A+5s'
    4     1        ASSIGN                                                   !1, '6h+%3A+27m+%3A+15s'
    6     2        ASSIGN                                                   !2, <array>
   12     3        INIT_FCALL                                               'preg_split'
          4        SEND_VAL                                                 '%2F%5CD%2B%2F'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !3, $9
   13    10        INIT_FCALL                                               'preg_split'
         11        SEND_VAL                                                 '%2F%5CD%2B%2F'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !4, $11
   15    17        SPACESHIP                                        ~13     !3, !4
         18        ASSIGN                                                   !5, ~13
   16    19        CONCAT                                           ~15     !5, '+-%3E+'
         20        FETCH_DIM_R                                      ~16     !2, !5
         21        CONCAT                                           ~17     ~15, ~16
         22        ECHO                                                     ~17
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
236.58 ms | 1004 KiB | 14 Q